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

Help with missing counter

Zaphery

New Member
Joined
Dec 14, 2009
Messages
28
Reaction score
0
I have a question, on my ot I use the command exhaustion = "20000"
on the spells.xml, and it is 20 seconds exhaustion for use it again... so when i use the spell this is going to 19... 18... to 0 (it means it's ready for make the spell other time) so where can i find this counter for put on doPlayerSendTextMessage like a message that says "This spell canno't be used after 19 seconds" for exemple ?
 
Use a storage value with os.time() for storing exhaust and differentiate time.

I'm using this scripts on spells i'm using tfs 210

local config =
{
seconds = 5,
storage = 987,
msg = "Please wait!"
}

function onCastSpell(cid, var)
if getPlayerStorageValue(cid, config.storage) == 1 then
doPlayerSendCancel(cid, config.msg)
return TRUE
end
setPlayerStorageValue(cid, config.storage, 1)
addEvent(useAgain, config.seconds*1000, cid)
return doCombat(cid, combat, var)
end

I want to change the msg like This spell canno't be used after 5 seconds" for exemple but i don't know how to do
 
Back
Top