TheGrimReaper Posted May 29, 2018 Share Posted May 29, 2018 local skin = 1 function onps() if getElementModel == 0 then skin = 0 else skin = 1 end end addEventHandler("onPlayerWasted", root, onps) function onspn(source) if skin == 0 then setElementModel(source, 0) else end end addEventHandler("onPlayerWasted", root, onspn) This is a Script that is suppose to keep the skin same as CJ if Cj skin was applied when the player died ( obviously u guys will know from the code) But its or some reason not functioning , and i am not a pro either so please help me with this Link to comment
Z4Zy Posted May 29, 2018 Share Posted May 29, 2018 (edited) When player be with CJ skin before die , it is no need to set player's skin to CJ skin when player die. Use, "onPlayerSpawn" event to set the player's skin to 0 / CJ skin Server Side :- addEventHandler("onPlayerSpawn", root, function () setElementModel ( source, 0 ) end ) I think this will be usefull. Edited May 29, 2018 by DeadthStrock 1 Link to comment
TheGrimReaper Posted May 29, 2018 Author Share Posted May 29, 2018 but in this case even if the person is not using CJ skin he/she wi be turned into CJ 1 Link to comment
Z4Zy Posted May 29, 2018 Share Posted May 29, 2018 Didn't you want to do that, when player dies and spawn, that player's skin should CJ skin not another. Isn't it ?? Link to comment
TheGrimReaper Posted May 29, 2018 Author Share Posted May 29, 2018 yeah but only if the player was using CJ skin when he/she died and also there is a lil mistake on script ,sorry Link to comment
Z4Zy Posted May 29, 2018 Share Posted May 29, 2018 what about this ? addEventHandler("onPlayerWasted", root, function () if ( getElementModel(source) == 0 ) then setElementData(source,"CJ",true) else setElementData(source,"CJ",false) end end ) addEventHandler("onPlayerSpawn", root, function () if ( getElementData(source,"CJ") == true ) then setElementModel(source, 0) end end ) 1 Link to comment
TheGrimReaper Posted May 29, 2018 Author Share Posted May 29, 2018 thank you very much bro , it works just as i wanted it to 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