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

[Request] Teleport at level 130

Nevalopo

Demigod
Joined
Jul 21, 2008
Messages
5,165
Reaction score
68
Location
Sweden, Landskrona
I dont know if its possible... But maybe it is with onAdvance?? I tryed mixing some with it but i couldent get it working.. What i want it to do is when they reach level 130 they will be teleported to a specified location and saying a message like "You have reached level 130 and teleported to city" Donnu if its possible but.. If it is.. Please help me out
Thanks
 
Never tried with the build in onAdvance in TFS, but here is my shot at it:

data/creaturescripts/scripts/newlevel.lua
Code:
function onAdvance(cid, skill, oldlevel, newlevel)
	local position = { x = x, y = y, z = z }
	local skill = SKILL__LEVEL
	if newlevel == 130 then
		doTeleportThing(cid, newpos, 0)
	end
	return TRUE
end

data/creaturescripts/creaturescripts.xml
Code:
<event type="advance" name="NewLevel" script="newlevel.lua"/>

data/creaturescripts/scripts/login.lua
Code:
    registerCreatureEvent(cid, "NewLevel")

Im not at home, so I cannot test anything...
 
Hmm..

Well... When i get lvl 130 with a char this error comes up:
[14/11/2008 22:37:08] Lua Script Error: [CreatureScript Interface]
[14/11/2008 22:37:08] data/creaturescripts/scripts/newlevel.lua:eek:nAdvance

[14/11/2008 22:37:08] attempt to index a nil value
[14/11/2008 22:37:08] stack traceback:
[14/11/2008 22:37:08] [C]: in function 'doTeleportThing'
[14/11/2008 22:37:08] data/creaturescripts/scripts/newlevel.lua:5: in function <data/creaturescripts/scripts/newlevel.lua:1>

Donnu really what im supposed to edit... the local position = { x = x, y = y, z = z }
or the doTeleportThing(cid, newpos, 0) ??
 
Last edited:
Well... When i get lvl 130 with a char this error comes up:
[14/11/2008 22:37:08] Lua Script Error: [CreatureScript Interface]
[14/11/2008 22:37:08] data/creaturescripts/scripts/newlevel.lua:eek:nAdvance

[14/11/2008 22:37:08] attempt to index a nil value
[14/11/2008 22:37:08] stack traceback:
[14/11/2008 22:37:08] [C]: in function 'doTeleportThing'
[14/11/2008 22:37:08] data/creaturescripts/scripts/newlevel.lua:5: in function <data/creaturescripts/scripts/newlevel.lua:1>

Ooops, my bad.
Change doTeleportThing(cid, newpos, 0) to doTeleportThing(cid, position, 0)
 
I think the easiest way to do it is to set some storage to 1 when entering Main Land and adding onLogin check:
Code:
    if getPlayerStorageValue(cid, storage) == TRUE then
        if getPlayerLevel(cid) < 6 then
            doTeleportThing(cid, pos, 0)
        end
    end

Dont really know if it can be done with onDeath or onAdvance.
 
Back
Top