WelCome Posted May 4, 2018 Share Posted May 4, 2018 (edited) Hi today i wanted to create anty-relog system but i got error what's wrong with this code? local coltable = {} addEventHandler("onPlayerWeaponFire",root,function() local x, y, z = getElementPosition(source) coltable[source] = createColSphere(x,y,z,100) for _,v in pairs(getElementsWithinColShape(coltable[source],"player")) do outputChatBox("TesT",v) end end) setTimer(function(plr) destroyElement(coltable[source]) end,3000,0) db3 : destroyElement(coltable[source]) Edited May 4, 2018 by WelCome Link to comment
!#NssoR_) Posted May 4, 2018 Share Posted May 4, 2018 Try this way. local coltable = {} addEventHandler("onPlayerWeaponFire",root, function() if ( coltable[source] ) then return end local x,y,z = getElementPosition(source) coltable[source] = createColSphere(x,y,z,100) for _,v in pairs(getElementsWithinColShape(coltable[source],"player")) do outputChatBox("TesT",v) end if ( coltable[source] ~= true ) then destroyElement(coltable[source]) coltable[source] = true setTimer(function (me) if ( coltable[me] ) then coltable[me] = nil end end, 2500,1,source) 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