fivem
fivem copied to clipboard
GetEntityHealth server side return 0
What happened?
GetEntityHealth for vehicle return 0 when creating the vehicle using server setter, a player need to enter into the vehicle scope so GetEntityHealth return the real value
Expected result
Default value of a vehicle (1000)
Reproduction steps
RegisterCommand("raiju", function(source)
local coords = GetEntityCoords(GetPlayerPed(1))
local vehicle = CreateVehicleServerSetter(`raiju`, "plane", coords.x, coords.y, coords.z)
repeat
Wait(0)
until DoesEntityExist(vehicle)
print("Raiju Health", GetEntityHealth(vehicle)) -- going to return 0
end, false)
Importancy
There's a workaround
Area(s)
FiveM, FXServer, OneSync
Specific version(s)
On every verions
Additional information
No response