Maniucza
~Lua~ Noob
Hello.I decided to write a script which is that as a player pockets the 10 lvl is automatically teleported to the data coordinates
Data/creaturescripts/autotp.lua
Data/creaturescripts.xml
And yet login.lua at the bottom of the "return true"
Bye.
Data/creaturescripts/autotp.lua
PHP:
local lvl = 10 -- level players
local pos = {x=100, y=100, z=7} -- where teleport player
function onAdvance(cid, skill, oldLevel, newLevel)
local pPos = getPlayerPosition(cid)
if getPlayerLevel(cid) == lvl then
doTeleportThing(cid, pos)
doSendMagicEffect(pPos, 28)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Congratulations you have been teleports!")
return TURE
end
end
Data/creaturescripts.xml
PHP:
<event type="advance" name="AutoTP" script="autotp.lua"/>
And yet login.lua at the bottom of the "return true"
PHP:
registerCreatureEvent(cid, "AutoTP")
Bye.