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

Help with script to teleport

Cezinha

New Member
Joined
May 15, 2010
Messages
14
Reaction score
0
Hello, I need your help. I made a script for a spell that teleports the player, so he's going through walls, mountains, trees, water in order that everything goes through the front. The point is that I want to know how you can not put him through these things.

Script is here:
PHP:
onSay function (cid, words, param, channel)

Local dire getCreatureLookDirection = (cid)
storevalue = 2468
alerttime = 15

Kapos getCreaturePosition = (cid)
NPOs kapos.x = (x = y = kapos.y + 3, z = kapos.z)
lpos kapos.x = (x = - 3, y = kapos.y, z = kapos.z)
SPOs kapos.x = (x = y = kapos.y - 3, z = kapos.z)
opos = (x = kapos.x + 3, y = kapos.y, z = kapos.z)

if direction == 0 then
IF (alert (cid, storevalue, alerttime) == 1) then
addEvent (doRemovePedra, 3 * 1000, kapos.x = (x, y = kapos.y, z = kapos.z, stackpos = 2))
doPlayerAddMana (cid, -45)
doTeleportThing (cid, nPos)
doSendMagicEffect (Kapos, 2)
doSendMagicEffect (NPOs, 2)
doCreateItem (1285.1, Kapos)
doSendAnimatedText (NPOs, "Kawarimi" TEXTCOLOR_ORANGE)
end
end


if direction == 1 then
if (alert (cid, storevalue, alerttime) == 1) then
addEvent (doRemovePedra, 3 * 1000, kapos.x = (x, y = kapos.y, z = kapos.z, stackpos = 2))
doPlayerAddMana (cid, -45)
doTeleportThing (cid, lpos)
doSendMagicEffect (Kapos, 2)
doSendMagicEffect (lpos, 2)
doCreateItem (1285.1, Kapos)
doSendAnimatedText (lpos, "Kawarimi" TEXTCOLOR_ORANGE)
end
end


if direction == 2 then
if (alert (cid, storevalue, alerttime) == 1) then
addEvent (doRemovePedra, 3 * 1000, kapos.x = (x, y = kapos.y, z = kapos.z, stackpos = 2))
doPlayerAddMana (cid, -45)
doTeleportThing (cid, SPOs)
doSendMagicEffect (Kapos, 2)
doSendMagicEffect (SPOs, 2)
doCreateItem (1285.1, Kapos)
doSendAnimatedText (SPOs, "Kawarimi" TEXTCOLOR_ORANGE)
end
end


if direction == 3 then
if (alert (cid, storevalue, alerttime) == 1) then
addEvent (doRemovePedra, 3 * 1000, kapos.x = (x, y = kapos.y, z = kapos.z, stackpos = 2))
doPlayerAddMana (cid, -45)
doTeleportThing (cid, opos)
doSendMagicEffect (Kapos, 2)
doSendMagicEffect (opos, 2)
doCreateItem (1285.1, Kapos)
doSendAnimatedText (opos, "Kawarimi" TEXTCOLOR_ORANGE)
end
end

return TRUE
end

Thanks
 
Code:
onSay function (cid, words, param, channel)
Local direction = getCreatureLookDirection(cid)
storevalue = 2468
alerttime = 15

Kapos getCreaturePosition = (cid)
NPOs kapos.x = (x = y = kapos.y + 3, z = kapos.z)
lpos kapos.x = (x = - 3, y = kapos.y, z = kapos.z)
SPOs kapos.x = (x = y = kapos.y - 3, z = kapos.z)
opos = (x = kapos.x + 3, y = kapos.y, z = kapos.z)

if direction == 0 then
IF (alert (cid, storevalue, alerttime) == 1) then
addEvent (doRemovePedra, 3 * 1000, kapos.x = (x, y = kapos.y, z = kapos.z, stackpos = 2))
doPlayerAddMana (cid, -45)
doTeleportThing (cid, nPos)
doSendMagicEffect (Kapos, 2)
doSendMagicEffect (NPOs, 2)
doCreateItem (1285.1, Kapos)
doSendAnimatedText (NPOs, "Kawarimi" TEXTCOLOR_ORANGE)
end
end


if direction == 1 then
if (alert (cid, storevalue, alerttime) == 1) then
addEvent (doRemovePedra, 3 * 1000, kapos.x = (x, y = kapos.y, z = kapos.z, stackpos = 2))
doPlayerAddMana (cid, -45)
doTeleportThing (cid, lpos)
doSendMagicEffect (Kapos, 2)
doSendMagicEffect (lpos, 2)
doCreateItem (1285.1, Kapos)
doSendAnimatedText (lpos, "Kawarimi" TEXTCOLOR_ORANGE)
end
end


if direction == 2 then
if (alert (cid, storevalue, alerttime) == 1) then
addEvent (doRemovePedra, 3 * 1000, kapos.x = (x, y = kapos.y, z = kapos.z, stackpos = 2))
doPlayerAddMana (cid, -45)
doTeleportThing (cid, SPOs)
doSendMagicEffect (Kapos, 2)
doSendMagicEffect (SPOs, 2)
doCreateItem (1285.1, Kapos)
doSendAnimatedText (SPOs, "Kawarimi" TEXTCOLOR_ORANGE)
end
end


if direction == 3 then
if (alert (cid, storevalue, alerttime) == 1) then
addEvent (doRemovePedra, 3 * 1000, kapos.x = (x, y = kapos.y, z = kapos.z, stackpos = 2))
doPlayerAddMana (cid, -45)
doTeleportThing (cid, opos)
doSendMagicEffect (Kapos, 2)
doSendMagicEffect (opos, 2)
doCreateItem (1285.1, Kapos)
doSendAnimatedText (opos, "Kawarimi" TEXTCOLOR_ORANGE)
end
end

return TRUE
end
 
Back
Top