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

Lua Couldown script dont work

Blysco

New Member
Joined
Oct 12, 2013
Messages
163
Reaction score
2
My Scirpt i want a Couldown for it !
Please help me

Code:
local newpos = {x=32369, y=32241, z=7}

function onUse(cid, item, frompos, item2, topos)
local inFight = hasCondition(cid, CONDITION_INFIGHT)
if not inFight then
doSendMagicEffect(getPlayerPosition(cid),1)
doTeleportThing(cid,newpos)
local tele = doCreateTeleport(1387, newpos, frompos) -- Creates teleport
addEvent(doRemoveItem, 5000, tele.uid) -- Removes teleport after 5 seconds
doCreatureSay(cid, "Teleportet back to Thais !" ,1)
else
doPlayerSendTextMessage(cid,25,"You can't use the teleport scroll if you are PZ LOCKED!!")
return true
end

    end
 
You can insert either of these two into your script.
Code:
if exhaustion.get(cid, 12345) then
    doPlayerSendCancel(cid, "Test.")
    return true
end

exhaustion.set(cid, 12345, 30) -- 30 seconds
or
Code:
local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, 2000) -- time in milliseconds

if hasCondition(cid, CONDITION_EXHAUST) then
    doPlayerSendCancel(cid, "Test")
    doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
    return false
end

doAddCondition(cid, exhaust)
 
Back
Top