• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

doPlayerAddStamina a nil value

1268995

Member
Joined
Sep 9, 2010
Messages
422
Reaction score
13
1zi2aq.png


I got this bug in this script:

Code:
function onUse(cid, item, frompos, item2, topos)
    doPlayerAddStamina(cid, 2520)
    doSendMagicEffect(frompos, 1)
    doRemoveItem(item.uid, 1)
return 1
end
 
Seems like there is no doPlayerAddStamina function, maybe try this one?

Code:
function onUse(cid, item, frompos, item2, topos)
doPlayerSetStamina(cid, getPlayerStamina(cid) + 2520)
doSendMagicEffect(frompos, 1)
doRemoveItem(item.uid, 1)
return 1
end
 
Thanks @Danger II , worked!!

@narko also maded a script, hope it help someone:

Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local cfg = {}
cfg.refuel = 42 * 60 * 1000
if(getPlayerStamina(cid) >= cfg.refuel) then
doPlayerSendCancel(cid, "Your stamina is already full.")
elseif(not isPremium(cid)) then
doPlayerSendCancel(cid, "You must have a premium account.")
else
doPlayerSetStamina(cid, cfg.refuel)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Your stamina has been refilled.")
doRemoveItem(item.uid)
end
return true
end

The only "problem" in both script is that i need to log out to stamina go full, stamina do not go full imediatly when i use the item, but that not a big problem!

Thanks for both!
 
Back
Top