I am trying to make a electrical car harpoon ( from 2 fast and 2 furious ).
I want to stop railguns damage.
SetPlayerWeaponDamageModifier is not working sometimes… sometimes it does.
Current code for disabling railguns damage:
Citizen.CreateThread(function()
local isHarpoon = false
while true do
Citizen.Wait(0)
local ped = GetPlayerPed(-1)
local pid = PlayerId()
local currentWeaponHash = GetSelectedPedWeapon(ped)
if currentWeaponHash == GetHashKey('WEAPON_RAILGUN') then
isHarpoon = true
SetPlayerWeaponDamageModifier(ped,0)
else
SetPlayerWeaponDamageModifier(ped,1)
isHarpoon = false
end
end
end