Hey I want make a Anti RPG spam script i made it u can only shoot every 7 seconds but it isnt work , it worked 3-5 months ago and i re-add it then not work anymore idk why
DEBUG
CINantiRPGspam/antiSpammm.lua:15: Bad usage @'addEventHandler'['onClientPlayerWeaponSwitch' with this function is already handled]
CINantiRPGspam/antiSpammm.lua:16: Bad usage @'addEventHandler'['onClientPlayerWeaponFire' with this function is already handled]
timer = {}
addEventHandler("onClientPlayerWeaponFire", localPlayer,
function(weapon)
if weapon == 35 then
setElementData(localPlayer, "anti repeater", true);
if ( getElementData(localPlayer, "anti repeater") == true ) then
timer[source] = setTimer( function()
toggleControl("fire", true)
toggleControl("aim_weapon", true);
setElementData(localPlayer, "anti repeater", false);
removeEventHandler("onClientPlayerWeaponSwitch", getRootElement(), cancelShots);
removeEventHandler("onClientPlayerWeaponFire", getRootElement(), cancelShots);
end, 7000, 1 )
addEventHandler("onClientPlayerWeaponSwitch", getRootElement(), cancelShots);
addEventHandler("onClientPlayerWeaponFire", getRootElement(), cancelShots);
end
end
end)
function cancelShots()
if ( getPedWeapon(localPlayer) == 35 ) then
toggleControl("fire", false);
toggleControl("aim_weapon", false);
else
toggleControl("aim_weapon", true);
toggleControl("fire", true);
end
end
Question
KissMTA
Hey I want make a Anti RPG spam script i made it u can only shoot every 7 seconds but it isnt work , it worked 3-5 months ago and i re-add it then not work anymore idk why
DEBUG
CINantiRPGspam/antiSpammm.lua:15: Bad usage @'addEventHandler'['onClientPlayerWeaponSwitch' with this function is already handled]
CINantiRPGspam/antiSpammm.lua:16: Bad usage @'addEventHandler'['onClientPlayerWeaponFire' with this function is already handled]
Link to comment
0 answers to this question
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