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

Use door and teleport somewhere

healer007

New Member
Joined
Nov 11, 2008
Messages
174
Reaction score
0
Location
doesnt matter
Hey can anyone help me with this script

Code:
function onUse(cid, item, frompos, item2, topos)
newpos == {x=353, y=441, z=8}
if item.itemactionid == 1030 then
doTeleportThing(cid, newpos)
doSendMagicEffect(newpos, 12)
end
return 1
end

should work like this> use door get teleported somewhere (newpos) and if you are NOT standing infront of the door you get error saying stand infront of the door or somefin like that
thnx
 
Code:
function onUse(cid, item, frompos, item2, topos)

local newpos == {x=353, y=441, z=8}

    if item.actionid == 1030 then
       doTeleportThing(cid, newpos)
       doSendMagicEffect(newpos, 12)
    end
return 1
end
 
PHP:
function onUse(cid, item, frompos, item2, topos)
newpos = {x=353, y=441, z=8}

if item.actionid == 1030 then
doTeleportThing(cid, newpos)
doSendMagicEffect(newpos, 12)
end
return 1
end

now : )
 
ty alot it works fine
but there's one more thing i want.
The script works on only from ([X: 351] [Y: 441] [Z: 8]) and teleports you to {x=353, y=441, z=8}. Now what if i want to use the SAME door from pos ([X: 353] [Y: 441] [Z: 8]) to [X: 351] [Y: 441] [Z: 8]. How do i do that?
can anyone make me a script thnx
 
Code:
function onUse(cid, item, frompos, item2, topos) 
oldpos = {x= 351,y=441, z=8}
newpos = {x=353, y=441, z=8} 

if item.actionid == 1030 and getPlayerLevel(cid) >= 30 then
doTeleportThing(cid, newpos) 
doSendMagicEffect(newpos, 12) 
else
doPlayerSendCancel(cid, "You do not have enough level to go through.")
end 
return 1 
end

This the script that works like this> use door from position A and get teleported to {x=353, y=441, z=8} which is position B (the other side of the door)

Now if a player is on position B and uses the door he doesnt go anywhere, he stays in position B. How do I make it so that when you use the door from position A you get teleported to position B and when your on B you get teleported to A (using the same door).

Can anyone fix the script for me thnx.
 
Code:
function onUse(cid, item, frompos, item2, topos) 
local oldpos = {x= 351,y=441, z=8}
local newpos = {x=353, y=441, z=8} 
local getnewpos = getThingFromPos(newpos)
local getoldpos = getThingFromPos(oldpos)

   if item.actionid == 1030 and getPlayerLevel(cid) >= 30 and getoldpos > 1 then
      doTeleportThing(cid, newpos) 
      doSendMagicEffect(newpos, 12)
   elseif getnewpos.itemid > 1 then
      doTeleportThing(cid, oldpos)
      doSendMagicEffect(oldpos, 12)
   else
      doPlayerSendCancel(cid, "You do not have enough level to go through.")
   end 
   return TRUE
end
 
i have 100% work for tfs 0.3.6 [8.54]
use this
function onUse(cid, item, fromPosition, itemEx, toPosition)
local newPos = {x=1000, y=1000, z=7}
doTeleportThing(cid, newPos)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_HEARTS)
return true
end

good luck man
 
Back
Top