Hey there,
atm, I’m trying to build a simple resource to always restore the player’s stamina. So I tried SetPlayerStamina, ChangePedStamina and RestorePedStamina but on all of those I get the error message
SCRIPT ERROR: [...] attempt to call a nil value (global '[...]')
I also tried the native GetTransportPedIsSeatedOn which throws the same error. But Native SetPlayerInvincible works fine, as well as PlayerPedId().
Current client.lua:
Citizen.CreateThread(function()
local ped2 = PlayerPedId()
local transport = GetTransportPedIsSeatedOn(ped2)
print(transport)
while true do
SetPlayerInvincible(ped2, true)
RestorePedStamina(ped2, 100.0)
Citizen.Wait(1)
end
end)
Current fxmanifest.lua:
fx_version 'cerulean'
game 'rdr3'
client_script 'client.lua'
rdr3_warning 'I acknowledge that this is a prerelease build of RedM, and I am aware my resources *will* become incompatible once RedM ships.'
Can someone help me? Did someone experience the same issue and knows how to resolve it?
(I used this reference: RedM Native Reference)
~ Turner