• 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!

how??

Flourence

New Member
Joined
Sep 22, 2009
Messages
60
Reaction score
4
*i want to know how to make that
when i use an item thing is removed from x position after x time and that time is broadcasted like
5
4
3
2
1
start

*
when i make a pvp arena when players attack each other they can enter protection zone even when they have battle. like the battle sign of arena dont prevent player from getting in pzones??
 
Lua:
local Time1 = 0 
local Use1 = 0 
local timecount = 10 

local function exhaust(cid, storevalue, exhausttime)
-- Exhaustion function by Alreth, v1.1 2006-06-24 01:31
-- Returns 1 if not exhausted and 0 if exhausted
    
    newExhaust = os.time()
    oldExhaust = getPlayerStorageValue(cid, storevalue)
    if (oldExhaust == nil or oldExhaust < 0) then
        oldExhaust = 0
    end
    if (exhausttime == nil or exhausttime < 0) then
        exhausttime = 1
    end
    diffTime = os.difftime(newExhaust, oldExhaust)
    if (diffTime >= exhausttime or diffTime < 0) then
        setPlayerStorageValue(cid, storevalue, newExhaust) 
        return 1
    else
        return 0
    end
end

local function onTime1(z) 
 if isPlayer(z.cid) == 1 then 
 ppos = getPlayerPosition(z.cid) 
  if getCreatureCondition(z.cid, CONDITION_INFIGHT) == 1  then 
   stopEvent(time1) 
   stopEvent(Use1) 
   doPlayerSendTextMessage(z.cid, 21, "Teleport Canceled Because of IN-FIGHT!") 
  else
   if timecount > 0 then
    Time1 = addEvent(onTime1, 1000, z)
   end
   timecount = timecount-1
   doPlayerSendTextMessage(z.cid, 21, "Teleporting in " .. timecount .. " second.")
   doSendMagicEffect(ppos, 53)
end
 else 
  stopEvent(time1) 
  stopEvent(Use1) 
 end 
end 
local function onUse1(z) 
 if isPlayer(z.cid) == 1 then 
  if getCreatureCondition(z.cid, CONDITION_INFIGHT) == 0 then 
   ppos = getPlayerPosition(z.cid)  
   stopEvent(time1) 
   if z.item.itemid == 7727 then 
    npos = {x=840,  y=701,  z=7} 
    doTeleportThing(z.cid, npos) 
    doPlayerSendTextMessage(z.cid, 21, "Teleported.") 
    doSendMagicEffect(npos,40) 
    doSendMagicEffect(npos,10) 
    doSendMagicEffect(ppos,10) 
    stopEvent(time1) 
   end  
  else 
   stopEvent(time1) 
   doPlayerSendTextMessage(z.cid, 21, "Teleport Canceled.") 
  end 
 end 
end 

function onUse(cid, item, ppos, frompos, item2, topos) 
 local z = {cid = cid, item = item, ppos = ppos, item2 = item2, topos = topos} 
 if isPremium(cid) then 
  if getCreatureCondition(z.cid, CONDITION_INFIGHT) == 0 then 
	if (exhaust(cid, 9143, 11) > 0) then
		Time1 = addEvent(onTime1, 1000, z) 
		Use1 = addEvent(onUse1, 11000, z) 
		timecount = 10
	else 
   doPlayerSendCancel(cid, "You cannot use a teleport scroll again until you have been teleported.") 
   doSendMagicEffect(frompos, 2) 
   end
   	else 
   doPlayerSendCancel(cid, "You cannot use a teleport scroll when you are in a fight.") 
   doSendMagicEffect(frompos, 2) 
  end 
 else 
  doPlayerSendCancel(cid, "Only players with a Premium account can use teleport scroll.") 
  doSendMagicEffect(frompos, 2) 
 end 
 return 1 
end
Its from RoXoR Ot.
 
Back
Top