iiv03 Posted December 12, 2019 Share Posted December 12, 2019 (edited) hello guys i have two problem so when player write a command /garage he move into garage tunning i wanna do like if he staying in garage he start giving like slap.. so i used this setTimer(function () killPlayer(player) end, 5000, 1) he gives once and this setTimer(function () setElementHealth(player,0) end, 5000, 1) problem two if a player is in a garage and there is a random map the problem is that he moves to the spawn map and i wan't like this. i want if he is in a garage he stays in a garage If he is out player return to spawn map so what i use for functions? onMapStarting getElementData setElementData like this? EDIT:: the first problem i fixed i think problem it was on number 1 i mean here end, 5000, 1) i changed to 0 and work so could anyone help me in problem two? Edited December 12, 2019 by xFabel problem first fixed Link to comment
iiv03 Posted December 12, 2019 Author Share Posted December 12, 2019 (edited) EDIT2: i got here table why?? addEventHandler("onMapStarting", root, updateKiller) function updateKiller(player) if getElementData(player, "state") == "alive" then setElementHealth(player,0) end end i'm trying now like this but there is no error in debug function updateKiller() if getElementData(source,"state") == "alive" then setTimer(function () setElementHealth(source,0) end, 2500, 0) end end Edited December 12, 2019 by xFabel edit line to CODE Link to comment
justn Posted December 13, 2019 Share Posted December 13, 2019 When the map is starting you loop through all the players(or you can just use onClientMapStarting and check the localPlayer) , then check if the player is in the garage before killing. 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