iiv03 Posted November 13, 2019 Share Posted November 13, 2019 hey everyone i make that code and it didn't work with me function checkjoin() local players = getElementsByType("players") for k,v in ipairs(players) do if getElementData(v, "state") =="alive" then setElementHealth(v,0) end end end addEventHandler("onPlayerJoin",getRootElement(), checkjoin) addEventHandler("onRaceStateChanging",getRootElement(), checkjoin) Link to comment
komal Posted November 14, 2019 Share Posted November 14, 2019 your problem here local players = getElementsByType("players") replace it to: local players = getElementsByType ( "player" ) Link to comment
iiv03 Posted November 14, 2019 Author Share Posted November 14, 2019 (edited) 9 hours ago, komal said: your problem here local players = getElementsByType("players") replace it to: local players = getElementsByType ( "player" ) i try with this when player join didn't work it's tell me Failed in chat where problem? function checkjoin() local players = getElementType("player") setPlayerTeam(players, team[3]) if not players then outputChatBox("Failed") end end addEventHandler("onPlayerJoin",getRootElement(), checkjoin) btw when i use addCommandHandler in this a function and worked get me in the team but why that doesn't worked when join player? and x2 try function checkjoin(player) setPlayerTeam(player, team[3]) if not player then outputChatBox("Failed") end end addEventHandler("onPlayerJoin",getRootElement(), checkjoin) i think problem ("I did not use getTeamName?") Edited November 14, 2019 by xFabel Link to comment
Dimos7 Posted November 14, 2019 Share Posted November 14, 2019 where is your team table first Link to comment
iiv03 Posted November 14, 2019 Author Share Posted November 14, 2019 (edited) 1 hour ago, Dimos7 said: where is your team table first bro everything work but only when join server didn't warp me into team team = {} addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()), function(startedRes) team.syncElement = createElement("clanwar_syncElement", "clanwar_syncElement") setElementData(source,"16091976AntiStealScriptbyShimu01022009ReadingSecretCode","Passed") if getResourceName(getThisResource()) == getResourceName(startedRes) then team[3] = createTeam ( "Spectators", 255, 255, 255 ) --etc end end ) Edited November 14, 2019 by xFabel Link to comment
Overkillz Posted November 14, 2019 Share Posted November 14, 2019 16091976AntiStealScriptbyShimu01022009ReadingSecretCode Stop using my scripts without my permission. Was a mistake to upload an uncopiled' version with the ''security code some years ago. However, Im glad that I didnt know a lot of stuffs about scripting and I made a dirty code that for beginners might is confuse. Topic reported and regards. Link to comment
Moderators IIYAMA Posted November 14, 2019 Moderators Share Posted November 14, 2019 (edited) Locked for using a leaked resource without permission. Edited November 14, 2019 by IIYAMA Link to comment
Recommended Posts