Nerevr back
Member
- Joined
- Nov 7, 2014
- Messages
- 269
- Reaction score
- 7
i have tp and want player can use it 2x and then remove but i don't know how to edite
Code:
--Script by Sonical
local config = {
fromPosition = {x = 4487, y = 9954, z = 11}, -- top left cornor of the playground
toPosition = {x = 5511, y = 6652, z = 11}, -- bottom right cornor of the playground
}
local newpos = {x=3321, y=33254, z=7} --New position
function onUse(cid, item, frompos, item2, topos)
if not isInRange(getPlayerPosition(cid), config.fromPosition, config.toPosition) then
return doPlayerSendCancel(cid, "You can't use this items in event.")
end
if (exhaustion.check(cid, 17724)) then
doPlayerSendCancel(cid, "You will be able to use event teleport in "..tostring(exhaustion.get(cid, 17724)).." seconds.")
return true
end
local inFight = hasCondition(cid, CONDITION_INFIGHT)
if not inFight then
doSendMagicEffect(getPlayerPosition(cid), 2)
doTeleportThing(cid,newpos)
doSendMagicEffect(newpos,10)
exhaustion.set(cid, 17724, 80)
doRemoveItem(item.uid, 1)
else
doPlayerSendTextMessage(cid,25,"You could not use this teleport Now You or You have battel!")
end
return 1
end