Anyone knows how to get this rolling on TFS 1.0?
i've tried some things here and there but i'm too stupid to figure this out.
LUA:
addSta = {}
local config = {
timeToAdd = 3, --
addTime = 5, --
}
local function addStamina(cid)
if not isPlayer(cid) then
addSta[cid] = nil
return true
end
player:setStamina(cid, getStamina(cid) + config.addTime)
player:sendTextMessage(cid, 25, "You received "..config.addTime.." minutes of stamina.")
addSta[cid] = addEvent(addStamina, config.timeToAdd * 60 * 1000, cid)
end
function onStepIn(cid)
if isPlayer(cid) then
addSta[cid] = addEvent(addStamina, config.timeToAdd * 60 * 1000, cid)
end
return true
end
function onStepOut(cid)
if isPlayer(cid) then
stopEvent(addSta[cid])
addSta[cid] = nil
end
return true
end
i've tried some things here and there but i'm too stupid to figure this out.
Last edited by a moderator: