Jump to content

[HELPx6]Tazer


||BuLLeT||

Recommended Posts

Hey, its me again after long time, i got problem with tazer system, idk how to add it to taze only when player have stars,and i want that when cop taze crim with this, criminal not to loose heal!

server.lua

local time = 1 
  
addEvent("onShot", true) 
addEventHandler("onShot", root, 
function(hitElement) 
    setElementFrozen(hitElement, true) 
    setPedAnimation(hitElement, "ped", "KO_shot_stom") 
    setTimer(setElementFrozen, time*8000, 1, hitElement, false) 
    setTimer(setPedAnimation, time*8000, 1, hitElement) 
end) 

client.lua

local eTeams = { 
    ["Police"] = true, 
    ["Swat"] = true, 
    ["FBI"] = true, 
    ["Military"] = true 
} 
  
addEventHandler("onClientPlayerWeaponFire", root, 
function(weapon, _, _, _, _, _, hitElement) 
    if (hitElement) and (getElementType(hitElement) == "player") and (weapon == 23) then 
        local Team = getPlayerTeam(source) 
        local TeamName = Team and getTeamName(Team) or "" 
        if (eTeams[TeamName]) then 
            outputChatBox("You have tazed "..getPlayerName(hitElement), 255, 0, 0) 
            triggerServerEvent("onShot", localPlayer, hitElement) 
        end 
    end 
end) 

Link to comment
Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...