-- client
function check( attacker, weapon )
local theVehicle = getPedOccupiedVehicle ( getLocalPlayer )
if getElementType ( weapon ) == "Rammed" then
triggerServerEvent ( "kill", resourceRoot, attacker )
else
end
end
addEventHandler("onPlayerDamage"", root, check)
-- server
function kill(attacker)
outputChatBox("Collided.", source)
killPed(source, attacker)
end
addEvent( "kill", true )
addEventHandler( "kill", resourceRoot, kill ) -- Bound to this resource only, saves on CPU usage.
addCommandHandler("col", kill )-- this is just to test the kill
Hi i am trying to make a script that kills player instantly when hit by a car, can anyone pls help me out
nevermind my mistake xDDDDD
topic close