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

script request

Calon

Experienced Member
Joined
Feb 6, 2009
Messages
1,070
Reaction score
21
looking for script, that if player get lvl 70, auto send to x y z.
thanks:)
rep++
 
Create namescript.lua and paste:
LUA:
function onAdvance(cid, skill, oldLevel, newLevel)
local lvl = 70
local pos = {x=?, y=?, z=?}
	if newLevel == lvl then
		doTeleportThing(cid,pos,0)
	end
end

Also in creaturescript.xml add:
Code:
<event type="advance" name=[COLOR="red"]"teleport"[/COLOR] event="script" value="[COLOR="blue"]namescript.lua[/COLOR]"/>

And in login.lua add:
LUA:
registerCreatureEvent(cid, "teleport")

Edit: I tested it and works
 
Last edited:
Better: (Virrages: You script doesn't work if he has high exp and someone advances from lvl 69 to 71 :) )
LUA:
local lvl = 70 --New level
local newpos = {x=32247, y=33569, z=7} --New position
function onAdvance(cid, skill, oldLevel, newLevel)
if getPlayerStorageValue(cid,2333) == -1 then
	if getPlayerLevel(cid) >= lvl then
		  doSendMagicEffect(getPlayerPosition(cid), 2)
      		  doTeleportThing(cid,newpos)
     		  doSendMagicEffect(newpos,10)
		  setPlayerStorageValue(cid,2333,1)
	end
end
return 1
end
 
Back
Top