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

Teleport player rune

I have found this scriptbut for some reason it only works if the player is 1 block away. Can anyone help me so ucan use it if hes like 12 bloacks away??
function onUse(cid, item, frompos, item2, topos)

if getPlayerAccess(cid) == 10 then


player1pos = {x=topos.x, y=topos.y, z=topos.z, stackpos=253}
player1 = getThingfromPos(player1pos)


if player1.itemid > 0 then
temple = {x=877, y=893, z=7}
doSendMagicEffect(topos,12)
doTeleportThing(player1.uid,temple)
doSendMagicEffect(temple,13)
doPlayerSendTextMessage(player1.uid,22,"You have been teleported to the red team.")
return 0
else
doSendMagicEffect(frompos,2)
return 0
end
else
doPlayerSendTextMessage(cid,22,"Only Gods can use this rune.")
return 0
end
end
 
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if getCreatureCondition(cid, CONDITION_INFIGHT) then
		doPlayerSendCancel(cid, 'You can\'t teleport while in fight.')
	else
		doRemoveItem(item.uid)
		local old, new = getThingPos(cid), getPlayerMasterPos(cid)
		doTeleportThing(cid, new)
		doSendMagicEffect(old, CONST_ME_TELEPORT)
		doSendMagicEffect(new, CONST_ME_TELEPORT)
		doCreatureSay(cid, 'You have teleported to your home temple.', TALKTYPE_ORANGE_1, false, cid)
	end
	return true
end

Lua:
<action itemid="2500" event="script" value="tprune.lua"/>

Or you could try using >this
 
Back
Top