So earlier I asked for assistance in altering my Zip Ties, now I have noticed another issue. Players who are killed while zip-tied remain zip-tied into the next life. They can run full speed and switch weapons and what not, but some actions, such as picking up weapons are restricted. I was curious how I would go about making it so the script would end/set the player un-tied if they were to die. Here is the code involved:
Would this function do it?
--- Again I have very limited LUA knowledge and even scraping this up took me a good 15 minutes to figure out something that actually sounded remotely right.
function meta:DeadPlayer
if ply.nextspawn and Entity:IsTied() then
return self.TiedUp = false
end
hook.Add("PlayerDeath", "untieDeath", function(p)
print("Player has died.");
if (p:IsTied()) then
print("Player is tied... untying");
p:UntiePlayer(p);
end
end);
Nothing is printed in console. Does this function need to go in lua/autorun/server? Currently I have it in the code with the other stuff. http://puu.sh/auaSt/7dc964b1e1.png
if (SERVER) then
hook.Add("PlayerDeath", "untieDeath", function(p)
print("Player has died.");
if (p:IsTied()) then
print("Player is tied... untying");
p:UntiePlayer(p);
end
end);
end
Still not functioning and nothing printing in console. The file is being used on the server as well.