você pode usar no server-side
function setTaserAnim(group, anim)
for _, player in pairs(getElementsByType("player", root, true)) do
setPedAnimation(source, group, anim, -1, false, false, false)
setTimer(setPedAnimation, 10000, 1, source)
setElementData(source, "Taser", true)
setTimer(function()
setElementData(player, "Taser", false)
end, 10000, 1 )
end
end
end
addEvent("setTaserAnim", true)
addEventHandler("setTaserAnim", root, setTaserAnim)
e no client
addEventHandler("onClientKey", root,
function (button, press)
if getElementData(getLocalPlayer(),"Taser") then
if button == "F1" or button == "F2" or button == "F3" or button == "F4" or button == "F5" or button == "F6" or button == "t" or button == "m" or button == "x" or button == "u" or button == "i" or button == "o" or button == "b" or button == "x" or button == "mouse2" or button == "F9" then
cancelEvent()
end
end
end
)
cFunc["anim_check"] = function(attacker, wep)
if isElement(attacker) and getElementType(attacker) == "player" then
if wep == 23 then
cancelEvent()
triggerServerEvent("setTaserAnim", source, "CRACK", "crckdeth2")
end
end
end
addEventHandler("onClientPlayerDamage", root, cFunc["anim_check"])