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

Lua StepIn Tile

x1nject

New Member
Joined
Apr 24, 2010
Messages
118
Reaction score
0
Hello OTLand, im looking for a script:

Ok.

a Tile that only lets people under level 50 teleport to location x/x/x.

If the player is above level 50 and steps on the tile he will get kicked back to position x/x/x.

Thanks.


+rep :D
 
Here you are:

In movements/scrpits create file named "teleport.lua"
Lua:
local tp = {x=yourposx, y=yourposy, z=yourposz}
local tp1 = {x=yourposx1, y=yourposy1, z=yourposz1}
local level = getPlayerLevel(cid)

function onStepIn(cid, item, pos, fromPos)
	if level <= 50 and item.actionid == 2510 then
		doTeleportThing(cid,tp)
	elseif level > 50 and item.actionid == 2510 then
		doTeleportThing(cid,tp1)
	else
		return false
	end
end
In movements.xml add it:
Code:
<movevent type="StepIn" actionid="2510" event="script" value="teleport.lua"/>
And in map add tile with actionID = 2510

P.S. I'm not sure that it will be working
 
Last edited:
Code:
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
local v,p = getThingPos(cid),{x=1,y=1,z=1} -- CHANGE THE {} TO YOUR LIKINGS.	
	if isPlayer(cid) then
		if getPlayerLevel(cid) <= 50 then
			doTeleportThing(cid,p)
			doSendMagicEffect(v,10)
		else
			doTeleportThing(cid,fromPosition)
			doSendMagicEffect(v,10)
			doPlayerSendTextMessage(cid,27,'Only players of level 50 and lower allowed.')
		end
	end
	return true
end
 
Back
Top Bottom