So use onClientPlayerWeaponFire event instead. But, there is another important note:
and you are using the weaponID 3 so according to this list:
Weapon ids list
it is a melee weapon, so it won't work.
So what can we do now ??
We can try to find another event, and I found this event: onClientPlayerDamage
and it gives us an important parameter:
Great ! We can do it with this event:
function Stun( attacker )
outputChatBox("Took damage !")
local policeTeam = getTeamFromName("police")
if getPlayerTeam(attacker) == policeTeam and getPlayerTeam(source) ~= policeTeam and getElementModel(attacker) == 3 then
outputChatbox("Frozen !")
setElementFrozen(source, true)
end
end
addEventHandler("onClientPlayerDamage", localPlayer, Stun)
Tell me if it works.
Regards,
Citizen
yep, works, thanks man