KidMoppuc Posted July 2, 2015 Posted July 2, 2015 Hi, I am new to scripting, but why wont the setElementHealth work? Both the hiding cursor and hiding GUI work. (Client) function revivePlayer(button) if button == "left" then guiSetVisible(GUIEditor.window[1], not guiGetVisible ( GUIEditor.window[1] )) setElementHealth(player, 100) showCursor(false) end end Thanks!
Mr.Aleks Posted July 2, 2015 Posted July 2, 2015 There's nothing wrong in that code, post everything or explain it better.
KidMoppuc Posted July 2, 2015 Author Posted July 2, 2015 When that event is triggered, the GUI disappears and the Cursor no longer shows (as it was supposed to), however, the players health does not change to 100?
Gr0x Posted July 2, 2015 Posted July 2, 2015 I guess you are trying to set the health of your own player. Change the first argument from player to localPlayer like this. setElementHealth(localPlayer, 100)
KidMoppuc Posted July 2, 2015 Author Posted July 2, 2015 I tried that; function revivePlayer() if button == "left" then guiSetVisible(GUIEditor.window[1], not guiGetVisible ( GUIEditor.window[1] )) setElementHealth(localPlayer, 100) showCursor(false) end end Still nothing!
Mr.Aleks Posted July 2, 2015 Posted July 2, 2015 Try with this: setElementHealth(getLocalPlayer(), 100) And be sure about what i've said you before.
KidMoppuc Posted July 2, 2015 Author Posted July 2, 2015 Okay, so setElementHealth(getLocalPlayer(), 100) Did not work. The player is already spawned and playable! Any suggestions?
Mr.Aleks Posted July 2, 2015 Posted July 2, 2015 Can you show me the code where you spawn the player?
KidMoppuc Posted July 2, 2015 Author Posted July 2, 2015 Can you show me the code where you spawn the player? I'm using the default "play" gamemode, so isn't player already spawned? Or am I getting confused here?
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