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

2 onStep Scripts [help] REP++

AbsoluteX

Learning Lua
Joined
Nov 9, 2009
Messages
121
Reaction score
3
Location
Australia
Hello.

On my OT I want to use the teleports that take you to Shrines on RL tibia as my tps..
Anyway i have quite a few of them i was wondering if its possible to put all the positions and stuff in one script? if it is, would someone please make one for me? :)

Also i have tiles that i want to add level limits on like only levels 120+ can walk on it.. or 80+ can walk on it.. Also is this possible to put it all in one script? if so could i get that too?

Thanks in advance.
Rep++
 
Hey Cykotitan, i Rep'd you,
But that script is okay.. it has alot of unnecessary "stuff" idk what to call it >.<
Like, it checks if the player is premium, storage values or if he/she is a certain voc.. at least i think it does..

My one is simple, it should only teleport the player to the desired position:

LUA:
function onStepIn(cid, item, position, fromPosition)

    local newPos = {x = 100, y = 100, z = 7} 
    
               doTeleportThing(cid, newPos)
                doSendMagicEffect(newPos,10)
                
  end

This is all i want it to do.. but i wanna put all the positions into the one script..

Also with the level tiles, if the person doesnt meet the level requirements i want them to get tped to a certain position then get a message something like "You need level 100 to enter that area."

Thanks.
 
You can reuse actionids.
LUA:
local t = {
	[1000] = {x=100, y=100, z=7},
	[1001] = {x=100, y=100, z=7},
}

function onStepIn(cid, item, pos, fromPos)
	local p = t[item.actionid]
	doTeleportThing(cid, p)
	doSendMagicEffect(pos, CONST_ME_TELEPORT)
	doSendMagicEffect(p, CONST_ME_TELEPORT)
end
That way you won't need to use many different.
 
Last edited:
Just in case you still need a level tile script; here.
LUA:
function onStepIn(cid, item, pos, fromPos)
	if isPlayer(cid) and getPlayerLevel(cid) < 100 then
		doTeleportThing(cid, {x=100, y=100, z=7})
		doSendMagicEffect({x=100, y=100, z=7}, CONST_ME_TELEPORT)
		doCreatureSay(cid, 'You need level 100 to enter that area.', TALKTYPE_ORANGE_1, false, cid)
	end
end
 
Back
Top