• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

exp potion

Nosaa

New Member
Joined
Mar 6, 2013
Messages
31
Reaction score
0
Hello i want script when use items gave u 50% exp for one hour and u can use 2 every day im use tfs 3.6
 
http://otland.net/f16/amulet-experience-stage-58109/#post593427

For the exhaustion you can do it like this:
LUA:
local config = {
	rate = 1.5, 
	time = 1, -- Hours of Exp Time
	storage = 20011,
	exhauststorage = 9583,
	exhausttime = 43200 -- time in seconds
}
local function endExpRate(cid)
	if isPlayer(cid) == TRUE then
		doPlayerSetRate(cid, SKILL__LEVEL, 1) -- config.lua rate
		setPlayerStorageValue(cid, config.storage, -1)
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Your extra experience time has ended.")
	end
end
function onUse(cid, item, fromPosition, itemEx, toPosition)

	if exhaustion.check(cid, config.exhauststorage) then
		local time = exhaustion.get(cid, config.exhauststorage)
		local hours, minutes, seconds = math.floor (time / 3600), math.floor ((time - ((math.floor (time / 3600)) * 3600))/ 60), time - ((math.floor (time/60)) * 60)
		if time >= 7200 then
			text = ""..hours.." hours, "..minutes.." minutes and "..seconds.." seconds"
		elseif time >= 3600 then
			text = ""..hours.." hour, "..minutes.." minutes and "..seconds.." seconds"
		elseif time >= 60 then
			text = ""..minutes.." minutes and "..seconds.." seconds"
		else
			text = ""..seconds.." seconds"
		end
		doSendMagicEffect(getThingPos(cid), CONST_ME_POFF) 
		doPlayerSendCancel(cid, "You need to wait "..text.." before you can use this again.")
		return true
	end

	if(getPlayerStorageValue(cid, config.storage) < 0) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Your extra experience rate is now: " .. config.rate .. ". It will last for ".. config.time .." hour.")
		doPlayerSetRate(cid, SKILL__LEVEL, config.rate)
		setPlayerStorageValue(cid, config.storage, os.time() + config.time * 3600)
		addEvent(endExpRate, config.time * 3600 * 1000, cid)
                doRemoveItem(item.uid, 1)
		exhaustion.set(cid, config.exhauststorage, config.exhausttime)
	else
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You still have extra experience time left.")
	end
	return TRUE
end
 
Last edited:
Added, thought because of the exhaustion you didn't wanted them to be deleted, and I added 12 hours exhaustion, I assume that is what you wanted.
 
no limos i want when use one exp potion and after hour i can use one more but i can't use 3 in 24 hours ...example i used one in 1:00 and i bought more one in 3:00 i can use it but i can't use 3 in 24 hours and i must to w8 1:00 next day " sorry bad english"
 
Last edited:
Limos

i got it

Nosaa mean

the time for exp is 1 hr
and after this time end u can use another one after 1 hr

but if u used 2 in 1 day
u can't use the third one

like this for the first one
you have 1 hr of double exp
after 1 hr your exp has end

then he can use 1 again
and got the same msg

when he try to use the third one
he got this msg
sorry but u have used the allow double exp time today , please try use it tomorrow.
 
Limos

i got it

Nosaa mean

the time for exp is 1 hr
and after this time end u can use another one after 1 hr

but if u used 2 in 1 day
u can't use the third one

like this for the first one
you have 1 hr of double exp
after 1 hr your exp has end

then he can use 1 again
and got the same msg

when he try to use the third one
he got this msg
sorry but u have used the allow double exp time today , please try use it tomorrow.


Yes that i want
 
Back
Top