• 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 Scroll back to homecity exhaust dont work

Blysco

New Member
Joined
Oct 12, 2013
Messages
163
Reaction score
2
What musst i change that a player get teleportet to his home-City ?
And what is wrong with exhaust ??

I want 20 minutes exhaust time 2000secs
That means you cann use the scroll every 20 min to teleport you to your home City.

Please help me



Code:
local newpos = {x=32369, y=32241, z=7}
local time = 50
function onUse(cid, item, frompos, item2, topos)
local inFight = hasCondition(cid, CONDITION_INFIGHT)
if exhaustion.check(cid, 1949) then
return doPlayerSendCancel(cid, "Please Wait "..exhaustion.get(cid,1605)..".") and doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
end

if not inFight then
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_TELEPORT)
doTeleportThing(cid,newpos)
doCreatureSay(cid, "The scroll teleportet you back to your Home-City !", TALKTYPE_ORANGE_1)
exhaustion.set(cid, 1605, time)

else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You can't use the teleport scroll if you are PZ LOCKED!!")
end
return true
end
 
Does this work?
Code:
local time = 50
function onUse(cid, item, frompos, item2, topos)
local inFight = hasCondition(cid, CONDITION_INFIGHT)
if exhaustion.check(cid, 1949) then
return doPlayerSendCancel(cid, "Please Wait "..exhaustion.get(cid,1605)..".") and doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
end

if not inFight then
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_TELEPORT)
doTeleportThing(cid,(getPlayerTown(cid))
doCreatureSay(cid, "The scroll teleportet you back to your Home-City !", TALKTYPE_ORANGE_1)
exhaustion.set(cid, 1605, time)

else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You can't use the teleport scroll if you are PZ LOCKED!!")
end
return true
end
 
This Script Is Totally Missed Up
A Fixed One
Code:
local time = 50
function onUse(cid, item, frompos, item2, topos)
local inFight = hasCondition(cid, CONDITION_INFIGHT)
if exhaustion.check(cid, 1949) then
return doPlayerSendCancel(cid, "Please Wait "..exhaustion.get(cid,1949)..".") and doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
end

if not inFight then
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_TELEPORT)
doTeleportThing(cid,(getPlayerTown(cid))
doCreatureSay(cid, "The scroll teleportet you back to your Home-City !", TALKTYPE_ORANGE_1)
exhaustion.set(cid, 1949, time)

else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You can't use the teleport scroll if you are PZ LOCKED!!")
end
return true
end
 
Error in line 10/11 ??
Whats wrong :O
I just added and changed something but it wont work with your version of the script.
 
Try with this, (time code goes to Limos)
Code:
local exhaustStorage, exhaustTime = 1949, 1200

function onUse(cid, item, fromPosition, itemEx, toPosition)
    if exhaustion.check(cid, exhaustStorage) then
    local time = exhaustion.get(cid, 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 >= 3600 then
        text = hours.." "..(hours == 1 and "hour" or "hours")..", "..minutes.." "..(minutes == 1 and "minute" or "minutes").." and "..seconds.." "..(seconds == 1 and "second" or "seconds")
    elseif time >= 120 then
        text = minutes.." "..(minutes == 1 and "minute" or "minutes").." and "..seconds.." "..(seconds == 1 and "second" or "seconds")
    else
        text = seconds.." "..(seconds == 1 and "second" or "seconds")
    end

        doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
        doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You need to wait " .. text .. " before you can use the scroll again.")
         return true
     end

     if not hasCondition(cid, CONDITION_INFIGHT) then
         doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT)
         doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
         doCreatureSay(cid, "The scroll teleportet you back to your Home-City !", TALKTYPE_ORANGE_1)
     else
         doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You can't use the teleport scroll if you are PZ LOCKED!!")
     end

     exhaustion.set(cid, exhaustStorage, exhaustTime)
     return true
end
 
Wtf thank you so much :DDD

Im just new in this buisness thats because im not so good with lua :D


ah sry it works nice !
 
Back
Top