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

Lua TP Scroll / HearthStone Problems!

Sweddy

Well-Known Member
Joined
Feb 14, 2009
Messages
2,907
Reaction score
93
Location
Sweden
I Need to get this hearthstone/tp scroll script to work like, so you cant tp while ure in pz... Please Help! And I heard some ppls said it just dissappeared when it was in their bp after some times :S

function onUse(cid, item, frompos, item2, topos)
ppos = getPlayerPosition(cid)
temple = getPlayerMasterPos(cid)
if (getCreatureCondition(cid, CONDITION_INFIGHT) == FALSE) then
doTeleportThing(cid, temple, TRUE)
doSendMagicEffect(ppos,66)
doSendAnimatedText(frompos,'Teleport!',16)
else
doPlayerSendCancel(cid,"You can't teleport immediately after fight.")
doSendMagicEffect(ppos,2)
end
return TRUE
end
 
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local pos = getThingPos(cid)
	if getTileInfo(pos).protection then
		doPlayerSendCancel(cid, 'You cannot use this inside a protection zone.')
	elseif getCreatureCondition(cid, CONDITION_INFIGHT) then
		doPlayerSendCancel(cid, 'You can\'t teleport immediately after fight.')
	else
		doTeleportThing(cid, getPlayerMasterPos(cid))
		doSendMagicEffect(pos, 66)
		doSendAnimatedText(pos, 'Teleport!', 16)
		return true
	end
	return doSendMagicEffect(pos, CONST_ME_POFF)
end
 
if they say it the script must have
doRemoveItemId(item.id)

i think smth like that else they lie.
 
Back
Top