• 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!

Solved Exahusted on this Script?

Code:
local cPos = {x = xxx, y = xxx, z = x}
local STORE_VALUE = 3567 -- Value where exhaust is saved.
local EXHAUST_TIME = 1 -- Exhaust time in seconds.

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if item.uid == xxx and item.itemid == 1945 then
		doSummonCreature("Monster", cPos)
	end
end


function exhaust(cid, STORE_VALUE, EXHAUST_TIME)
    
    newExhaust = os.time()
    oldExhaust = getPlayerStorageValue(cid, STORE_VALUE)
    if (oldExhaust == nil or oldExhaust < 0) then
        oldExhaust = 0
    end
    if (EXHAUST_TIME == nil or EXHAUST_TIME < 0) then
        EXHAUST_TIME = 1
    end
    diffTime = os.difftime(newExhaust, oldExhaust)
    if (diffTime >= EXHAUST_TIME) then
        setPlayerStorageValue(cid, STORE_VALUE, newExhaust) 
        return 1
    else
        return 0
    end
end

Exhaustion system, Made by Alreth
 
try
Lua:
local cPos = {x = xxx, y = xxx, z = x}
local exhaust,storage = 5, 1299 -- in seconds,empty storage

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if getPlayerStorageValue(cid,storage) > os.time() then
		doPlayerSendTextMessage(cid,27,os.date("You are exhausted, you need to wait more %S seconds.",getPlayerStorageValue(cid,storage) - os.time()) )
		return true
	end
	if item.uid == xxx and item.itemid == 1945 then
		doSummonCreature("Monster", cPos)
		setPlayerStorageValue(cid,storage,os.time() + exhaust)
	end
	return true
end
 
Back
Top Bottom