Nerevr back
Member
- Joined
- Nov 7, 2014
- Messages
- 269
- Reaction score
- 7
i have this script i want to edite it
whan player use teleport and than move the teleport stop or if he lots items from bp teleport stop too
tfs 0.4
whan player use teleport and than move the teleport stop or if he lots items from bp teleport stop too
Code:
function count(name,time,pos)
local cid = getCreatureByName(name)
if cid then
if not (getCreatureCondition(cid,CONDITION_INFIGHT)) and not (isPlayerPzLocked(cid)) then
if time > 0 then
doPlayerSendTextMessage(cid,MESSAGE_TYPES["green"],"You will be teleported in ".. time .. " seconds.")
addEvent(count,2*1000, name, time - 2, pos)
else
doTeleportThing(cid,pos,false)
doSendMagicEffect(getThingPos(cid),10)
end
else
doPlayerSendTextMessage(cid,MESSAGE_TYPES["green"],"Teleport to temple cancelled as you have battle sign.")
end
end
return true
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
local scrollid = 2348 -- Id of your rune.
local temple = getPlayerMasterPos(cid) -- Dont touch
if getPlayerStorageValue(cid, 1338) >= os.time() then
doPlayerSendTextMessage(cid,MESSAGE_TYPES["green"],"You can't use this item while you are jailed")
return true
end
local coolDown = os.time() - getPlayerStorageValue(cid, 1338)
if coolDown < 300 then
doPlayerSendTextMessage(cid,MESSAGE_TYPES["green"],"Your teleporter is in cooldown of 5 minutes. Please wait.")
return true
end
if (getCreatureCondition(cid,CONDITION_INFIGHT)) or (isPlayerPzLocked(cid)) then
doPlayerSendTextMessage(cid,MESSAGE_TYPES["green"],"You can't use this while you are in battle.")
return true
end
count(getCreatureName(cid),10,temple)
setPlayerStorageValue(cid,1338, os.time())
return true
end
Last edited: