• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Hive wall. Click it and move to other side.

Forte

New Member
Joined
Jun 9, 2013
Messages
12
Reaction score
0
Theres a wall (hive wall in this case) and when i click on it i want to move to other side of it, like quest door etc.

TFS 0.3.

IF possible and you have enough skill is it possible to make the scirpt that i dont have to add every X/Y position.
If not thats fine too.

like this

LUA:
function onUse(cid, item, frompos, item2, topos)
         if getPlayerVipDays(cid) >= 1 then
            pos = getPlayerPosition(cid)
            if pos.x == topos.x then
               if pos.y < topos.y then
                  pos.y = topos.y + 1
               else
                  pos.y = topos.y - 1
               end
            elseif pos.y == topos.y then
                   if pos.x < topos.x then
                      pos.x = topos.x + 1
                   else
                      pos.x = topos.x - 1
                   end
            else
                doPlayerSendTextMessage(cid,22,"Stand in front of the door.")
            return true
            end
            doTeleportThing(cid,pos)
            doSendMagicEffect(topos,12)
         else
            doPlayerSendTextMessage(cid,22,'Only VIP Account can go there.')
         end
         return true
end

Thanks.
 
Last edited:
LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local pos = getCreaturePosition(cid)
	if (item.itemid == XXX) then
	local pos = getPlayerPosition(cid)
	if pos.x < toPosition.x then
		doTeleportThing(cid, {x=toPosition.x+1,y=toPosition.y,z=toPosition.z})
		doSendMagicEffect(getPlayerPosition(cid), 12)
	elseif pos.x > toPosition.x then
		doTeleportThing(cid, {x=toPosition.x-1,y=toPosition.y,z=toPosition.z})
		doSendMagicEffect(getPlayerPosition(cid), 12)
	elseif (item.itemid == XXX) and pos.y < toposition.y then
		doteleportThing(cid, {x=toPosition.x,y=toPosition.y+1,z=toPosition.z})
		doSendMagicEffect(getPlayerPosition(cid), 12)
	elseif pox.y > toPosition.y then
		doteleportThing(cid, {x=toPosition.x,y=toPosition.y-1,z=toPosition.z})
		doSendMagicEffect(getPlayerPosition(cid), 12)
	end
	end
	end
Action.xml
LUA:
<action itemid="XXX;XXX" script="NextDoor.lua"/>

Don't forget to edit the XXX to item id of the hive wall and in action.xml​
 
LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local pos = getCreaturePosition(cid)
	if (item.itemid == XXX) then
	local pos = getPlayerPosition(cid)
	if pos.x < toPosition.x then
		doTeleportThing(cid, {x=toPosition.x+1,y=toPosition.y,z=toPosition.z})
		doSendMagicEffect(getPlayerPosition(cid), 12)
	elseif pos.x > toPosition.x then
		doTeleportThing(cid, {x=toPosition.x-1,y=toPosition.y,z=toPosition.z})
		doSendMagicEffect(getPlayerPosition(cid), 12)
	elseif (item.itemid == XXX) and pos.y < toposition.y then
		doteleportThing(cid, {x=toPosition.x,y=toPosition.y+1,z=toPosition.z})
		doSendMagicEffect(getPlayerPosition(cid), 12)
	elseif pox.y > toPosition.y then
		doteleportThing(cid, {x=toPosition.x,y=toPosition.y-1,z=toPosition.z})
		doSendMagicEffect(getPlayerPosition(cid), 12)
	end
	end
	end
Action.xml
LUA:
<action itemid="XXX;XXX" script="NextDoor.lua"/>

Don't forget to edit the XXX to item id of the hive wall and in action.xml​

Thanks for helping,
Script seems to be working great!
 
Back
Top