Xwad Posted September 5, 2015 Share Posted September 5, 2015 Hi i made a script that makes possible when the player has skin id 20 and press H then he will be healed. Its not working:/ what should be the problem? the debugscript says its a bad argumentum (getElementalHealth) function heal () local theHealth = getElementHealth (localPlayer) if getElementModel(source) == 20 then if ( theHealth < 100 ) then setElementHealth ( localPlayer, getElementHealth(localPlayer) + 50 ) unbindKey("h","down",heal) setTimer (bindTheKeys , 7000, 1 ) end end end function bindTheKeys () bindKey ( "h", "down", heal ) end bindTheKeys() Link to comment
JR10 Posted September 5, 2015 Share Posted September 5, 2015 If localPlayer is not defined (according to debugscript) then this script is server-side, make sure it's client-side. Also, change any 'source' variable to 'localPlayer', since source is not defined. Link to comment
Xwad Posted September 5, 2015 Author Share Posted September 5, 2015 Working thanks!!!<3 Link to comment
TAPL Posted September 5, 2015 Share Posted September 5, 2015 This better: bindKey("h", "down", function() if not isTimer(hT) and getElementModel(localPlayer) == 20 then local theHealth = getElementHealth(localPlayer) if (theHealth < 100) then setElementHealth(localPlayer, theHealth + 50) hT = setTimer(function() hT = nil end, 7000, 1) end end end) Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now