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

doTeleportCreatureToPos()

Shawak

Intermediate OT User
Joined
Sep 11, 2008
Messages
1,984
Solutions
2
Reaction score
119
Location
Germany
GitHub
Shawak
Here a usefull function that teleport player, and send magic effects.

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:
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
 
Don't know that that work:
doSendMagicEffect(newPos, effectNewPos == nil and 10 or effectNewPos)

Thanks + Rep++ :thumbup:.

Regards,
Shawak
 
Back
Top