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

Teleport problem in training area

Fady

Anderion.net
Joined
Aug 13, 2009
Messages
572
Reaction score
17
Location
Egypt
Hello otlanders!
I just want an easy movement script..
my training area is like that: -> http://i40.tinypic.com/34fbgpz.png <- so i want a movement script which allows only 1 player to stand on the tile which the magic forcefield teleports you to..if another tried to enter it says "You cannot enter here while another player is training."
anyone could help me with that?

Thanks
Fady
 
- give your teleports in rme 0, 0, 0 pos (on the outside!!)
- give your teleports neu aid nr like 11111

add in movements.xml
<movevent type="StepIn" actionid="11111" event="script" value="teletreins.lua"/>
scripts/teletreins.lua
LUA:
function onStepIn(cid, item, position, fromPosition)
	if(not isPlayer(cid)) then return false end

	local neupos = position
	neupos.stackpos = STACKPOS_TOP_MOVABLE_ITEM_OR_CREATURE
	neupos.x = neupos.x - 3

	if getThingFromPos(neupos).uid < 1 then
		doTeleportThing(cid, fromPosition, false)
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "blabla player in")
		doSendMagicEffect(position, CONST_ME_MAGIC_BLUE)
	else
		doTeleportThing(cid, fromPosition)
	end
	return true
end

now test :)
 
Last edited:
LUA:
function onStepIn(cid, item, position, fromPosition)
	if(not isPlayer(cid)) then return false end
 
	local neupos = position
	neupos.stackpos = STACKPOS_TOP_MOVABLE_ITEM_OR_CREATURE
	neupos.x = neupos.x - 3
 
	if getThingFromPos(neupos).uid < 1 then
		doTeleportThing(cid, neupos, false)
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Whuiiiiii")
		doSendMagicEffect(position, CONST_ME_MAGIC_BLUE)
	else
		doTeleportThing(cid, fromPosition)
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "edit this :P player in")
	end
	return true
end

now tested, works :)
 
Last edited:
Code:
function onStepIn(cid, item, position, fromPosition)
	if(not isPlayer(cid)) then return false end
 
	local neupos = {x=position.x-3, y=position.y, z=position.z, stackpos=253}

	if getThingFromPos(neupos).uid > 0 then
		doTeleportThing(cid, fromPosition, false)
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "blabla player in")
		doSendMagicEffect(position, CONST_ME_MAGIC_BLUE)
	else
		doTeleportThing(cid, neupos)
	end
	return true
end
 
LUA:
function onStepIn(cid, item, position, fromPosition)
	if(not isPlayer(cid)) then return false end
 
	local neupos = position
	neupos.stackpos = STACKPOS_TOP_MOVABLE_ITEM_OR_CREATURE
	neupos.x = neupos.x - 3
 
	if getThingFromPos(neupos).uid < 1 then
		doTeleportThing(cid, neupos, false)
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Whuiiiiii")
		doSendMagicEffect(position, CONST_ME_MAGIC_BLUE)
	else
		doTeleportThing(cid, fromPosition)
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "edit this :P player in")
	end
	return true
end

now tested, works :)
i still cant enter, but i get 18:19 Whuiiiiii
and 18:19 edit this :P player in
;/ my server is TFS 0.4
 
19:12 You see a magic forcefield.
ItemID: [1387], ActionID: [13688].
Position: [X: 984] [Y: 730] [Z: 7].

i added AID from map..
 
Last edited by a moderator:
-tibia test player: training bug.jpg
-script:
1. data\movements\scripts/teletrains.lua
script.jpg
2. movements.lua
script2.jpg
and yeah 13688 is my free aid nr :)
 
Back
Top