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

[Request] Tile

Tibia Rox

Member
Joined
Feb 4, 2009
Messages
1,181
Reaction score
9
Location
U.S.A
I need a script that when you pull the lever [ID1945] while standing on position xxxx,you will be teleported to position xxxx, but you can only be there for x amount of minutes :)

When you get into the room you are teleported in, in orange text it will say "You have x amount of minutes in this room"

(Very similar to Killing in the name of... quests.

Thanks in advance!
 
Something like that, try to complete it
LUA:
function onUse(cid, item, frompos, item2, topos)
player1pos = {x=frompos.x+1, y=frompos.y, z=7, stackpos=253}
player1 = getThingfromPos(player1pos)
	if player1.itemid == 1 then 
				
				setPlayerStorageValue(cid, 11555, 1) 
				local timed = 15 -- HERE ENTER MINUTES THA PLAYER CAN BE IN THE ROOM
				local czas = 0
					local function timer(i)
						if(getPlayerStorageValue(cid, 11555)==1)then
						xpos = {x=1000, y=1000, z=7} -- POS WHEN THE TIME ENDED
						npos = {x=1000, y=1000, z=7}
						end
					doTeleportThing(i.cid, xpos)
					doPlayerSendTextMessage(cid, 19, 'your time has ended!')
					end
					if(czas == 0)then
					addEvent(timer, (timed*60000), {cid=cid, npos=getThingfromPos(getPlayerPosition(cid))})
					doPlayerSendTextMessage(cid, 19, 'you have 15 minutes!')
					nplayer1pos = {x=1616, y=1250, z=7} -- Pos where player will be teleported
					doSendMagicEffect(player1pos,2)
					doRemoveItem(kasa.uid,kasa.type)
					doTeleportThing(player1.uid,nplayer1pos)
					doSendMagicEffect(nplayer1pos,10)
					czas = os.time()
					end
					if(os.time() <= (czas+timed*30))then
					stopEvent(timer)
					end
	else
	doPlayerSendCancel(cid,"you must stay on the right tile.")
	end
end
 
Back
Top