for some reason it does not send the teleport effect as it should, feel free to let me know what I did wrong
Lua:
local rebornToPass = MoveEvent()
rebornToPass:type("stepin")
local config = {
[52501] = { reborn = 5, des = "you must be atleast reborn 5 to access." },
[52502] = { reborn = 10, des = "you must be atleast reborn 10 to access." },
[52503] = { reborn = 15, des = "you must be atleast reborn 15 to access." },
[52504] = { reborn = 20, des = "you must be atleast reborn 20 to access." },
[52505] = { reborn = 25, des = "you must be atleast reborn 25 to access." },
[52506] = { reborn = 30, des = "you must be atleast reborn 30 to access." },
[52507] = { reborn = 35, des = "you must be atleast reborn 35 to access." },
[52508] = { reborn = 40, des = "you must be atleast reborn 40 to access." },
[52509] = { reborn = 45, des = "you must be atleast reborn 45 to access." },
[52510] = { reborn = 50, des = "you must be atleast reborn 50 to access." }
}
function rebornToPass.onStepIn(player, item, position, fromPosition)
if not player then
return true
end
local reb = config[item.actionid]
if player:getReborn() < reb.reborn then
player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, reb.des)
player:teleportTo(fromPosition)
end
return true
end
for i = 52501, 52510 do
rebornToPass:aid(i)
end
rebornToPass:register()