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

Teleport script

mujica

New Member
Joined
Feb 3, 2010
Messages
203
Reaction score
3
Hello, i would like an onLevelUp script so when a player reaches level xx he is teleported to x,y,z it's a very simple script.

Thanks in advance.
 
Should be what you're looking for

Lua:
local config = {
	xyz = {x = 1000, z = 1000, y = 7},
	level = 250,
	storage = 3000
}

function onAdvance(cid, skill, oldlevel, newlevel)
    if skill == SKILL__LEVEL and newLevel == config.level and getCreatureStorage(cid, 3000) < 0 then
		doTeleportThing(cid, config.xyz)
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
		doCreatureSetStorage(cid, 3000, 1)
	end
	return true
end
 
Isn't it better to use newLevel >= config.level?
Just incase if he went from 249 to 251+ or something? (skipping that whole 250)
 
Isn't it better to use newLevel >= config.level?
Just incase if he went from 249 to 251+ or something? (skipping that whole 250)

maybe, but if he wanted to do that i'm sure he can just add the > sign, i tend to just do exactly what the requests say, rather then modifying it as to what i'd do :p
 
Back
Top