CesarZ
Well-Known Member
- Joined
- Sep 20, 2012
- Messages
- 272
- Solutions
- 4
- Reaction score
- 66
Hey guys i have been trying to put a restriction in my lua. it seems like im always failing.
This is the Teleport Scroll.lua
I have been trying to put this one.
This is the Teleport Scroll.lua
LUA:
local newpos = {x=781, y=1001, z=7}
local time = 1--in second
function onUse(cid, item, fromPosition, itemEx, toPosition)
local inFight = getCreatureCondition(cid, CONDITION_INFIGHT)
if exhaustion.check(cid, 1605) 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), 73)
doTeleportThing(cid,newpos)
doCreatureSay(cid, "TELEPORTED!!" ,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
I have been trying to put this one.
Code:
if not (player:getLevel() < 50) then
player:say("This Teleport scroll can only be use by level 50 or higher.", TALKTYPE_MONSTER_SAY)
return true