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

MoveEvent Teleport only for Premiums

megachock

Member
Joined
Mar 12, 2009
Messages
115
Reaction score
7
Hey guys im learning scripting, this is my second script :D is very simple but usefull.

In movements/movements.xml

Code:
<movevent type="StepIn" actionid="39812" event="script" value="PremiumTeleport.lua"/>

39812 is the action id of the teleport in the map.

In movements/scripts/
Copy any script and rename it PremiumTeleport.lua
and paste it inside:

Thanks to acubens for the cancel.

Lua:
function onStepIn(cid, fromPosition)
	
local pos = {x=1000, y=1000, z=7}
local txt = "You have been teleported."
local fail = "You are not premium."
 	
	if isPlayer(cid) and isPremium(cid) then
		doTeleportThing(cid, pos)
		doSendMagicEffect(pos, 12) 
		doPlayerSendTextMessage(cid, 22, txt)
	else
		doPlayerSendTextMessage(cid, 22, fail)
		doTeleportThing(cid, fromPosition)
	end
        return TRUE
end

local pos = position where player will be teleported
local txt = txt player will see when gets teleported
loca fail = text if the player cant be teleported
 
Last edited:
You miss tlp back if isn't premmy
Code:
function onStepIn(cid,[B][COLOR="#008000"] fromPosition[/COLOR][/B])
	
local pos = {x=1000, y=1000, z=7}
local txt = "You have been teleported."
local fail = "You are not premium."
 	
	if isPlayer(cid) and isPremium(cid) then
		doTeleportThing(cid, pos)
		doSendMagicEffect(pos, 12) 
		doPlayerSendTextMessage(cid, 22, txt)
	else
		doPlayerSendTextMessage(cid, 22, fail)
		[B][COLOR="#008000"]doTeleportThing(cid, fromPosition)[/COLOR][/B]
	end
        return TRUE
end
 
Last edited:
You miss tlp back if isn't premmy
Code:
function onStepIn(cid,[B][COLOR="#008000"] fromPosition[/COLOR][/B])
	
local pos = {x=1000, y=1000, z=7}
local txt = "You have been teleported."
local fail = "You are not premium."
 	
	if isPlayer(cid) and isPremium(cid) then
		doTeleportThing(cid, pos)
		doSendMagicEffect(pos, 12) 
		doPlayerSendTextMessage(cid, 22, txt)
	else
		doPlayerSendTextMessage(cid, 22, fail)
		[B][COLOR="#008000"]doTeleportThing(cid, fromPosition)[/COLOR][/B]
	end
        return TRUE
end

Thanks jeje, i missed that im just learning..
 
Last edited:
Back
Top