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

Heartstone..

Teddy

SweStream.se
Joined
Oct 2, 2008
Messages
3,797
Reaction score
10
Location
Sweden 172
Can some make a heartstone so when u press on (ITEM) you will get tp'd to temple (it will not work if you are in fight)
i have seen many scripts like this before but i cant find them now ..
 
local hs = 9999 -- put here your id of heartstone
idk what id heartstone have, so u need to replace id of your heartstone with this '9999'


PHP:
function onUse(cid, item, frompos, item2, topos)

local hs = 9999       -- put here your id of heartstone

local fight = getCreatureCondition(cid, CONDITION_INFIGHT)
local temple = getPlayerMasterPos(cid)

if item.itemid == hs then
   if fight ~= 0 then
      doPlayerSendCancel(cid, "YOU CANNOT USE A HEARTSTONE DURING A FIGHT")
   else
      doTeleportThing(cid,temple)
      -- doRemoveItem(cid, item.uid,1)              -- if u would a heartstone disappear after using remove the -- from start of line
   end
return TRUE
end
 
Last edited:
if item.uid ??

Maybe this is better
LUA:
local removee = false   -- to remove item set to true

local cooldown = 60   -- colldown to use it again

local storage = 6087    -- empty storage

function onUse(cid, item, frompos, item2, topos)

local temple = getTownTemplePosition(getPlayerTown(cid))

if(getPlayerStorageValue(cid, storage) > os.time()) then
   doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "You must wait another " .. getPlayerStorageValue(cid, storage) - os.time() .. ' second' .. ((getPlayerStorageValue(cid, storage) - os.time()) == 1 and "" or "s") .. " to teleport.")
else    
    
		if not hasCondition(cid,CONDITION_INFIGHT) then
                                 doTeleportThing(cid,temple,false)
                                 doSendMagicEffect(temple,10)
                                 doPlayerSendTextMessage(cid,25,"Teleported to temple safely.")
				 setPlayerStorageValue(cid, storage, os.time() + cooldown)
				 
                                               if removee == true then
	                                                     doRemoveItem(item.uid)
                                               end
					 
                else
                                 doPlayerSendCancel(cid,"You can't teleport to temple during fight")
                end
end	 
     
return TRUE
end
 
Last edited:
Back
Top