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

Looking for a script

mahant

Banned User
Joined
May 15, 2010
Messages
111
Reaction score
1
Hey,
I am looking for script that:

When you gain xx level, you have tp to pos xyz, and your Hometown is number 2
 
I do not know whether the works
LUA:
function onAdvance(cid, skill, oldlevel, newlevel)
local config = {
level = 100,
pos = {x=1000,y=1000,z=7},
townid = 2
}
	if newlevel == config.level and skill >= SKILL__LEVEL then
		doTeleportThing(cid,config.pos)
		doPlayerSetTown(cid,config.townid)
	end
return true
end
 
Creaturescripts.xml add
Code:
	<event type="advance" name="AdvanceTp" event="script" value="advancetp.lua"/>
login.lua add
Code:
	registerCreatureEvent(cid, "AdvanceTp")
advancetp.lua
LUA:
function onAdvance(cid, skill, oldlevel, newlevel)
local m = {3172, 100, 2} --First is storage value (don't touch it), 2 = level & 3 = townid
local t = m[2] + 10 --Don't touch
local newpos = {x=32225, y=33664, z=7} --Position
local status = getPlayerStorageValue(cid,m[1])
	if(getPlayerLevel(cid) >= m[2] and getPlayerLevel(cid) < t and status == -1)then
		doTeleportThing(cid,newpos)
		doPlayerSetTown(cid, m[3])
		setPlayerStorageValue(cid,m[1],1)
	end
return 1
end
--Sonical
 
Back
Top