Shawak
Intermediate OT User
Here a usefull function that teleport player, and send magic effects.
Example:
Regards,
Shawak
Lua:
function doTeleportCreatureToPos(cid, newPos, effectNewPos, effectOldPos)
if(cid ~= nil and newPos ~= nil) then
doSendMagicEffect(getCreaturePosition(cid), effectOldPos == nil and 2 or effectOldPos)
doTeleportThing(cid, newPos)
doSendMagicEffect(newPos, effectNewPos == nil and 10 or effectNewPos)
end
return TRUE
end
Example:
Lua:
function onSay(cid, words, param, channel)
doTeleportCreatureToPos(cid, {x=getCreaturePosition(cid).x-2,y=getCreaturePosition(cid).y,z=getCreaturePosition(cid).z},10,2)
return TRUE
end
Regards,
Shawak
Last edited: