• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Fix this tp scroll (add exhausted)

piraton

New Member
Joined
Jun 3, 2009
Messages
22
Reaction score
0
I want to introduce exhausted of 5 seconds to this script :)

scroll.lua
Code:
local teleport = {
	pos = {x = 163, y = 52, z = 7},
	effect = 12,
	effecto = 50,
	remove = 0, -- Si quieres que se remueva el item (0 = NO, 1 = SI)
	delay = 3
}
 
local function doTeleport(cid,delay,frompos,topos)
	if delay == 0 then
     
 	doSendMagicEffect(frompos,12)
		doTeleportThing(cid, topos)
		doSendMagicEffect(topos,teleport.effecto)
	else
		doCreatureSay(cid, "Tp en... "..delay.." ", TALKTYPE_ORANGE_1)
      doSendMagicEffect(frompos,12)
		addEvent(doTeleport,1000,cid,(delay - 1),frompos,topos)
	end
end
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
 
	if getCreatureSkullType(cid) >= 3 then
		doPlayerSendCancel(cid, "Ustes esta pk.")
		doSendMagicEffect(getCreaturePosition(cid),2)
		return false
	end
 
	if hasCondition(cid,CONDITION_INFIGHT) then
		doPlayerSendCancel(cid, "Tiene pz.")
		doSendMagicEffect(getCreaturePosition(cid),2)
		return false
	end
 
	if teleport.remove == 1 then
		doRemoveItem(item.uid, 1)
	end
 
		doCreatureSay(cid, "Preparandose para tp en... "..teleport.delay.." ", TALKTYPE_ORANGE_1)
		doSendMagicEffect(getCreaturePosition(cid),teleport.effect)
		addEvent(doTeleport,1000,cid,(teleport.delay - 1),getCreaturePosition(cid),teleport.pos)
	return true
end

Actions.xml
Code:
<action itemid="5809" event="script" value="Zero/scroll.lua"/>
 
Here you go, you can change the time and storage however you want:

Code:
local teleport = {
	pos = {x = 163, y = 52, z = 7},
	effect = 12,
	effecto = 50,
	remove = 0, -- Si quieres que se remueva el item (0 = NO, 1 = SI)
	delay = 3
}
 
local function doTeleport(cid,delay,frompos,topos)
	if delay == 0 then
     
 	doSendMagicEffect(frompos,12)
		doTeleportThing(cid, topos)
		doSendMagicEffect(topos,teleport.effecto)
	else
		doCreatureSay(cid, "Tp en... "..delay.." ", TALKTYPE_ORANGE_1)
      doSendMagicEffect(frompos,12)
		addEvent(doTeleport,1000,cid,(delay - 1),frompos,topos)
	end
end
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
 
[COLOR="#FF0000"] local exhaustStorage = 55555
 local exhaustTime = 5 -- in seconds[/COLOR]

 if not(exhaustion.check(cid,exhaustStorage)) then
 exhaustion.set(cid, exhaustStorage, exhaustTime)
			if getCreatureSkullType(cid) >= 3 then
				doPlayerSendCancel(cid, "Ustes esta pk.")
				doSendMagicEffect(getCreaturePosition(cid),2)
				return false
			end
		 
			if hasCondition(cid,CONDITION_INFIGHT) then
				doPlayerSendCancel(cid, "Tiene pz.")
				doSendMagicEffect(getCreaturePosition(cid),2)
				return false
			end
		 
			if teleport.remove == 1 then
				doRemoveItem(item.uid, 1)
			end
		 
				doCreatureSay(cid, "Preparandose para tp en... "..teleport.delay.." ", TALKTYPE_ORANGE_1)
				doSendMagicEffect(getCreaturePosition(cid),teleport.effect)
				addEvent(doTeleport,1000,cid,(teleport.delay - 1),getCreaturePosition(cid),teleport.pos)
	else
	doPlayerSendCancel(cid, "You are exhausted.")
	end	
	return true	
end
 
Back
Top