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

Remove just a teleport in a tile, it doesn't matter if there are items or ...

kito2

www.masteria.net
Joined
Mar 9, 2009
Messages
3,764
Solutions
1
Reaction score
227
Location
Chile, Santiago
Hello, I have a problem, the thing is that I have a event that creates a teleport, but before it creates, if a player stays over the tile and then the teleport is created and wait till the event finish, then the event will try to remove the teleport, but how there is a player on that tile, it isn't removed, so then the player moves and enter the teleport and then the teleport keeps opened for ever...

The idea is to create a globalevent that check a tile on a specific time:
  • If there is a player, then he is teleported to his town.
    [*]If there are some items, it will just remove the teleport.

Thanks, I rep++ :)

Can someone help me on this?
 
I don't completely understand, however this should remove a teleport.

LUA:
function onThink(cid, interval)
	if getThingFromPos({x = 100, y = 100, z = 7}, false).itemid == 1387 then
		doRemoveItem(getThingFromPos({x = 100, y = 100, z = 7}, false).uid)
	end
	return true
end

I hope it at least helps.

J.Dre
 
Thanks dude, but the idea is to check the entire tile to delete just the teleport instead if there are more items or players on the same tile.
 
In that case I believe the following should do the job:

LUA:
function onThink(cid, interval)
	local tp = getTileItemById({x = 100, y = 100, z = 7}, 1387)
	if tp.uid > 0 then -- Checking the teleport.
		doRemoveItem(tp.uid, 1) -- Removing the teleport on confirmation.
	end -- Ending the function.
	return true
end

Regards,
J.Dre
 
:D How about simply just checking if there is player on the tile u want to create teleport before creating it? If there is, teleport the player 1 tile out from his pos? :o
 
Add

LUA:
doTeleportThing(getTopCreature({x=32354,y=32213,z=7}).uid, {x=32354,y=32214,z=7})

Before

doCreateTeleport
 
Back
Top