local config = {
---- CONFIG ----
time = 10 -- after this seconds, the player will be teleportet
----------------
} -- Don't touch ----------------
local events = {}
local z = config.time
-------------------------------
function onUse(cid, item, fromPosition, itemEx, toPosition)
if isPlayerVip(cid) == TRUE then
local message = "You will be teleportet in: 10 sec"
if getPlayerGroupId(cid) >= 1 then
if getCreatureCondition(cid, CONDITION_INFIGHT) == FALSE then
events = addEvent(text,100,{cid = cid, z = z})
doPlayerSendTextMessage(cid,18,message)
else
doPlayerSendTextMessage(cid,18,"Sorry you have a battle sign.")
end
else
doPlayerSendTextMessage(cid,18,"Sry you are a gm :D, use /t.")
end
else
doPlayerSendTextMessage(cid,18,"Only VIP Player can use this.")
end
return TRUE
end
function text(parameters)
local cid = parameters.cid
local z = parameters.z
if z >= 1 then
if getCreatureCondition(cid, CONDITION_INFIGHT) == FALSE then
doPlayerSendTextMessage(cid,18,""..z.."")
z = z-1
events = addEvent(text,1000,{cid = cid, z = z})
else
events = nil
doPlayerSendMessage(cid,18,"Failed, you have pz")
end
elseif z == 0 then
if getCreatureCondition(cid, CONDITION_INFIGHT) == FALSE then
z = config.time
events = nil
doSendMagicEffect(getCreaturePosition(cid),2)
doTeleportThing(cid,(getTownTemplePosition(getPlayerTown(cid))))
doSendMagicEffect(getCreaturePosition(cid),28)
doPlayerSendTextMessage(cid,18,"You have teleported to temple.")
else
events = nil
doPlayerSendMessage(cid,18,"Sorry you have a battle sign.")
end
end
return TRUE
end