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

Level teleporters

simonnini

New Member
Joined
Sep 14, 2008
Messages
108
Reaction score
0
Hello.. I guess theres a possibility to make a script like this:

You need to be a certain level to enter a tp (changed from tp to tp) IF you are not the required level when you try to enter the tp you will get teleported to a special spot (Could be changed to)

I ain´t that good at scripting. So here i am to ask if some1 could make this for me ? Would be really usefull.

Thank you / Simon
 
create a file and nameitwhateveryouwant.lua

Code:
function onStepIn(cid, item, frompos, item2, topos)

local kickposition = {x=133, y=113, z=7} --Place where the Player will be teleported IF he is NOT the required level
local newposition = {x=1052, y=676, z=7} --Place where the player will be teleported IF he is the required level
local level = 100

	if getPlayerLevel >= level then
	    doPlayerSendTextMessage(cid, 19, "You are allowed to pass.")
				doSendMagicEffect(getPlayerPosition(cid),2) 
				doTeleportThing(cid, newposition) 
				doSendMagicEffect(newposition,10)
    else
        doPlayerSendTextMessage(cid, 19, "You aren't a VIP player!")
				doTeleportThing(cid, kickposition)
    end
end

and in the moveevents.xml add
Code:
<movevent type="StepIn" uniqueid="xxxx" event="script" value="whateveryouwrote.lua"/>

if i helped you PLEASE REP++ ME AND I GIVE IT BACK :ninja:
 
Does not work..
Also this would be hard to use if im going to change many tps.

A better script please ! :)

Well, thx for trying :D


Kind regards / Simon
 
Lua:
local tps = {
     [9000] = {lvl = 500 , place ={x=1000,y=1000,z=7}},
	 [9001] = {lvl = 12 , place ={x=1003,y=1000,z=7}},
	 [9002] = {lvl = 13 , place ={x=1002,y=1000,z=7}}
	 }
	 --[actionid] = {level   ,  place where they will be tped to}
function onStepIn(cid, item, frompos, item2, topos)

local tp = tps[item.actionid]
if not tp then
return true
end
if getPlayerLevel(cid) < tp.lvl then

    doPlayerSendCancel(cid,"Only players with lvl "..tp.lvl.." can pass.")
       
return true
end
doTeleportThing(cid, tp.place ,FALSE)
 doSendMagicEffect(getPlayerPosition(cid), 10)
return true
end

Code:
<movevent type="StepIn" itemid=1387" event="script" value="whateveryouwrote.lua"/>

make sure not to have another item id script with 1387
 
see it can be a simple tile or you want it to be the magic force field?

for the tile you can do this:

levelteleporter.lua
PHP:
local destiny = {x = 1000, y = 1000, z = 7}
local v = doPlayerSendCancel(cid, "You need to be at least level "..requiredlevel..".")
local tileid = 474
local tileuid = 1054
local requiredlevel = 200
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
	if isPlayer(cid) and item.itemid == tileid and item.uid == tileuid then
		if getPlayerLevel(cid) >= required level then
			doTeleportThing(cid, destiny)
		else
			v
		end
		return true
	end
	return true
end
return true

movement.xml file

PHP:
<movement type="StepIn" uniqueid="UNIQUE ID HERE" event="script" value="levelteleporter.lua"/>
 
Last edited:
Lua:
local t = {
	actionid = 1242, -- actionid that the TP has.
	level = 100, -- level you need to enter TP.
	tpto = {x=1,y=1,z=1} -- Where the player will be teleported to.
	}
	
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
local v = getThingPos(cid)
	if(isPlayer(cid) and item.actionid == t.actionid)then
		if(getPlayerLevel(cid) < t.level)then
			doTeleportThing(cid,fromPosition)
			doPlayerSendTextMessage(cid,27,'You can\'t enter this teleport until you are level '..t.level..'.')
		else
			doTeleportThing(cid,t.tpto)
			doSendMagicEffect(v,10)
		end
	end
	return true
end

register in movements.xml using actionid.
 
actually mine just works fine as i tested you need to make sure you dont have a action id used before as it wont give an error.
 
Back
Top