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

Solved Help me edit this script :(!

Cris2387

Member
Joined
Dec 30, 2013
Messages
177
Reaction score
9
Code:
function onUse(cid, item, frompos, item2, topos)

local level = 500



if getPlayerLevel(cid) < level then

return doPlayerSendTextMessage(cid,22,"Voce nao possui level suficiente.")

end

doTransformItem(item.uid, item.itemid + 1)

playerpos = getPlayerPosition(cid)

doorpos = {x = frompos.x, y = frompos.y, z = frompos.z, stackpos = 253}

if playerpos.y == doorpos.y + 1 and playerpos.x == doorpos.x then

doMoveCreature(cid, 0)

elseif playerpos.x == doorpos.x - 1 and playerpos.y == doorpos.y then

doMoveCreature(cid, 1)

elseif playerpos.y == doorpos.y - 1 and playerpos.x == doorpos.x then

doMoveCreature(cid, 2)

elseif playerpos.y == doorpos.y and playerpos.x == doorpos.x + 1 then

doMoveCreature(cid, 3)

elseif playerpos.x == doorpos.x + 1 and playerpos.y == doorpos.y - 1 then

doMoveCreature(cid, 4)

elseif playerpos.x == doorpos.x - 1 and playerpos.y == doorpos.y - 1 then

doMoveCreature(cid, 5)

elseif playerpos.x == doorpos.x + 1 and playerpos.y == doorpos.y + 1 then

doMoveCreature(cid, 6)

elseif playerpos.x == doorpos.x - 1 and playerpos.y == doorpos.y + 1 then

doMoveCreature(cid, 7)

end

return TRUE

end
I want the script to teleport the character not to move it so like instead of moving the character to the door, i want the character to just skip the door lol and get a cool effect when it does it :) im using it for a quest hehe
 
Either make them use the door or make a simple script to teleport the person..
Code:
function onUse(cid, item, frompos, item2, topos)
   local level = 500
   pos = {x=1059, y=1479, z=13}
   oldpos = getCreaturePosition(cid)
   
   if getPlayerLevel(cid) < level then
     return doPlayerSendTextMessage(cid,22,"Your level is insufficient.")
   else
     doTeleportThing(cid, pos)
     doPlayerSendTextMessage(cid,22,"You hear a thundering sound, then find yourself in a different part of the tunnel.")
     doSendMagicEffect(pos,10)
     doSendMagicEffect(oldpos,2)
   end
end
 
Either make them use the door or make a simple script to teleport the person..
Code:
function onUse(cid, item, frompos, item2, topos)
   local level = 500
   pos = {x=1059, y=1479, z=13}
   oldpos = getCreaturePosition(cid)
  
   if getPlayerLevel(cid) < level then
     return doPlayerSendTextMessage(cid,22,"Your level is insufficient.")
   else
     doTeleportThing(cid, pos)
     doPlayerSendTextMessage(cid,22,"You hear a thundering sound, then find yourself in a different part of the tunnel.")
     doSendMagicEffect(pos,10)
     doSendMagicEffect(oldpos,2)
   end
end
Wow thank you bud ! lol
 
Back
Top