• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

Tp to your own House if you own a House.

Bazi

Member
Joined
Oct 24, 2011
Messages
270
Reaction score
8
Location
Germany
Here a Script for Teleport item to your House.

Data->Actions->Scripts->tphouse.lua

Lua:
  function onUse(cid, item, fromPosition, itemEx, toPosition)
   return
   hasCondition(cid, CONDITION_INFIGHT) and
      doPlayerSendCancel(cid, "Sorry, you are in a fight.")
   or getPlayerLevel(cid) < getConfigInfo("levelToBuyHouse") and
      doPlayerSendCancel(cid, "Sorry, not possible.")
   or not getHouseByPlayerGUID(getPlayerGUID(cid)) and
      doPlayerSendCancel(cid, "Sorry, but you do not own a house.")
   or doTeleportThing(cid, getHouseEntry(getHouseByPlayerGUID(getPlayerGUID(cid))))
end

Data->Actions->Actions.xml

Lua:
	<action itemid="7722" event="script" value="tphouse.lua"/>
 
Can be used as a potion... with doRemoveItem(item.uid) xD
 
I used it on a tile in my temple.

Add this to movements:
Lua:
function onStepIn(cid, item, frompos, item2, topos)
	
	local kickposition = {x = 1003, y = 994, z = 7}
  
	if getPlayerLevel(cid) > getConfigInfo("levelToBuyHouse") then
		if getHouseByPlayerGUID(getPlayerGUID(cid)) then
			doPlayerSendTextMessage(cid, 19, "Home sweet home...")
					doSendMagicEffect(getPlayerPosition(cid),2) 
					doTeleportThing(cid, getHouseEntry(getHouseByPlayerGUID(getPlayerGUID(cid))))
					doSendMagicEffect(getPlayerPosition(cid),10)
		else
                doPlayerSendTextMessage(cid, 19, "You dont own any house.")
                doTeleportThing(cid, kickposition)
		end
		
       else
       doPlayerSendCancel(cid, "You cannot even buy a house. Go hunt!")
       doTeleportThing(cid, kickposition)
       end
end
 
Back
Top