hello all i need a help a help i want o disable minigun kills ,
for ex ;1 fire with minigun to 2,if 2 has enable minigun mode then 2 cant be killed & if 2 has disable minigun mode then he can get killed by 1 !!
i scripted cilent.lua but not working instead there is no errors too, help me if you can
client code;
addCommandHandler("minigun",
function ()
if ( getElementData(localPlayer, "Anti-minigun") ) then
setElementData(localPlayer, "Anti-minigun", false)
outputChatBox("Anti-minigun Disabled")
else
setElementData(localPlayer, "Anti-minigun", true)
outputChatBox("Anti-minigun Enabled")
end
end )
function stopMinigunDamage ( attacker, weapon, bodypart )
if ( weapon == 38 ) then
if (getElementData(localPlayer, "Anti-minigun")) then
cancelEvent()
end
end
end
addEventHandler ( "onClientPlayerDamage", getLocalPlayer(), stopMinigunDamage )