• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

[Movement] Premuim Only Portal

michaelE

New Member
Joined
Feb 15, 2011
Messages
2
Reaction score
0
Location
Eagar, Arizona
Hi, Everyone i have decided to release my premium only portal script.

First

Add this line to your movement.xml file <uniqueid="2001" event="script" value="nameofthescripthere"/>

Second

Open notepad and add the script then name it what ever you like and save it in to your movements folder

LUA:
config = {toIsland = {x = 1055, y = 741, z = 7,}, push = {x = 935, y = 749, z = 8,}}
function onStepIn(cid, item, position, fromPosition, toPosition)
local playerTime = getPlayerPremiumDays(cid)

	if (playerTime > 0) then
		doTeleportThing(cid, config.toIsland)
		local pos = getPlayerPosition(cid)
		doSendMagicEffect(pos, 10)
			
			
	else
		local pos = getPlayerPosition(cid)
		doRelocate(pos, config.push)
		doCreatureSay(cid, "You must be premuim to use", TALKTYPE_ORANGE_1)
	return true
	end
end

Hope it helps msg or post if you have questions. :)
 
Last edited:
1. move config before function star or else it will be set every time function is called(time waste)
2. it is two way portal I guess? you should just put aid instead of checkin position of used portal like
Code:
local tps = {
[aid1] ={x=1383, y=615, z=11},
[aid2]={x=1383, y=615, z=11} }
and then just doTeleportThing(cid, tps.[item.aid])
(or .actionid, I'm not sure now)

and you should at least push back non premium player or else char will stay on portal, sometimes it may cause problems

and last but not least: notepad likes to f*** up files, better use wordpad or notepad++(have syntax highlight for many languages)
 
Code Edited

Thank you for the information i figured someone would come with a better way to do it. I also took out the other portal since in remere's you can set destinations for portals also using it in the if statement could cause my players to be trapped on the island if there premuim ran out while they were hunting there. Also that was a great idea on the push characters could have blocked the portal other wise thanks again.
 
If you add a destination to the teleport and use "citizen.lua," this becomes a lot easier.

Code:
local position = {x = 100, y = 100, z = 7}
function onStepIn(cid, item, fromPosition, toPosition)
	if(isPlayer(cid) and not isPremium(cid)) then
		doTeleportThing(cid, position, false)
		doSendMagicEffect(position, CONST_ME_TELEPORT)
	end
end

For multiple teleports:

Code:
local t = {
	[1220] = {x = 100, y = 100, z = 7},
	[1221] = {x = 100, y = 100, z = 7}
}
 
function onStepIn(cid, item, fromPosition, toPosition)
	local k = t[[COLOR="#FF0000"]item.actionid[/COLOR]]
	if(k and isPlayer(cid)) then
		if(not isPremium(cid)) then
			doTeleportThing(cid, k, false)
			doSendMagicEffect(k, CONST_ME_TELEPORT)
		end
	end
end
Hope you can learn from these scripts. We need more coders out there... ;)
 
Last edited:
Back
Top