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

Actions - Rune Position requirements ?

Fresh

Quack!
Joined
Oct 21, 2009
Messages
1,855
Solutions
18
Reaction score
671
Hello all!
I have request for good scripters.
Code:
function onUse(cid, item, frompos, item2, topos)

npos = {x=topos.x, y=topos.y, z=topos.z}

if topos.x < 10000 then
doSendMagicEffect(topos,13)
doPlayerSay(cid,"Zanzoken !",16)
doTeleportThing(cid,npos)
else
doPlayerSendCancel(cid, "You cannot teleport here.")
end

return 1
end

TFS 0.3.5pl1

When you choose item - use with - click! And you teleported to position after click !

but... i can teleport to PZ Zones , Houses :/

Please add to this script requirement : " You cannot teleport to Protection Zone!" "You cannot teleport to somebody house."

Rep++
:peace:
 
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if toPosition.x < 10000 then
		doPlayerSendCancel(cid, "You cannot teleport here.")
	elseif getTileInfo(toPosition).house then
		doPlayerSendCancel(cid, "You cannot teleport to a house.")
	elseif getTileInfo(toPosition).protection then
		doPlayerSendCancel(cid, "You cannot teleport to a protection zone!")
	else
		doSendMagicEffect(toPosition, CONST_ME_MAGIC_RED)
		doCreatureSay(cid,"Zanzoken !", TALKTYPE_ORANGE_1)
		doTeleportThing(cid, toPosition)
	end
	return true
end
 
Cyko, all its great but:

1) I can teleport to item (example: im on quest and gate are for levels 200 and im level 100 and i can teleport).
2) I can teleport on lava and water...
3) I can teleport to unmoveable objects like: wall, doors, quest doors, stones, trees ... etc..

Can you fix it ?
 
Last edited:
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if toPosition.x < 10000 or doTileQueryAdd(cid, toPosition) ~= 1 or not isSightClear(getThingPos(cid), toPosition, true) then
		doPlayerSendCancel(cid, "You cannot teleport here.")
	elseif getTileInfo(toPosition).house then
		doPlayerSendCancel(cid, "You cannot teleport to a house.")
	elseif getTileInfo(toPosition).protection then
		doPlayerSendCancel(cid, "You cannot teleport to a protection zone!")
	else
		doSendMagicEffect(toPosition, CONST_ME_MAGIC_RED)
		doCreatureSay(cid,"Zanzoken !", TALKTYPE_ORANGE_1)
		doTeleportThing(cid, toPosition)
	end
	return true
end
 
Hello. How I can to do it on tfs 0.3.6pl1? The problem is that teleports me of only one sqm, because character first go the point of use. Help please.

edit.
allowfaruse="1", sorry.
 
Last edited:
Back
Top