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

[Actions] Rope Spot ID: 384

Fresh

Quack!
Joined
Oct 21, 2009
Messages
1,838
Solutions
18
Reaction score
617
Location
Poland
Hi script no-lifers ! :peace:
I need help!

Anyone can make me script:
If you click USE on Rope Spot (ID:384) you auto going on upper floor (Like Ladders), and you dont need rope for rope spot just click..

Rep++
TFS: 0.3.5pl1
Tibia: 8.50
:peace: Friend.
 
actions/scripts/rope.lua
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	doTeleportThing(cid, {x=toPosition.x, y=toPosition.y+1, z =toPosition.z-1}, false)
return true
end

actions/actions.xml
PHP:
<action itemid="384" event="script" value="rope.lua"/>
 
actions/scripts/rope.lua
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	doTeleportThing(cid, {x=toPosition.x, y=toPosition.y+1, z =toPosition.z-1}, false)
return true
end

actions/actions.xml
PHP:
<action itemid="384" event="script" value="rope.lua"/>
Last time I checked, actions weren't working for ground tiles. Elf might've changed it though.
 
actions/scripts/rope.lua
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	doTeleportThing(cid, {x=toPosition.x, y=toPosition.y+1, z =toPosition.z-1}, false)
return true
end

@Cyko,
It should work, I made an elevator system similar to this, but it was on different tiles.

Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	return doTeleportThing(cid, { x = toPosition.x, y = toPosition.y+1, z = toPosition.z-1 }, false)
end
 
@Cyko,
It should work, I made an elevator system similar to this, but it was on different tiles.

Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	return doTeleportThing(cid, { x = toPosition.x, y = toPosition.y+1, z = toPosition.z-1 }, false)
end

I gotta ask, what's the difference in our scripts except it's one word shorter?
Is it better to use return doTele... than doTele... return true? Oo
 
Last edited:
Thanks,
Sypher REP++

Thread Close please. :)
@ Edit:
I give you credits of my Dragon Ball OT project :D
 
Last edited:
I gotta ask, what's the difference in our scripts except it's one word shorter?
Is it better to use return doTele... than doTele... return true? Oo

Usage, but it doesn't make much of a difference in these small scripts.
 
I got problem, if i had on rope spot any blood or corpse i must wait to dissapear blood... and move out corpse..

Anyone can make me work without blood ?
 
try this;
local holeId = {384}
function onUse(cid, item, fromPosition, itemEx, toPosition)
local groundTile = getThingfromPos(toPosition)
if isInArray(holeId, itemEx.itemid) == TRUE then
local hole = getThingfromPos({x = toPosition.x, y = toPosition.y, z = toPosition.z + 1, stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE})
if hole.itemid > 0 then
doTeleportThing(hole.uid, {x = toPosition.x, y = toPosition.y + 1, z = toPosition.z}, FALSE)
else
doPlayerSendCancel(cid, "Sorry, not possible.")
end
else
return FALSE
end
return TRUE
end
 
@up
I know i need script similar to rope but if i click on rope spot teleports me up [looks rope]...
But if blood is on rope spot i cant click.. :/
 
Code:
local spotId = {384, 418, 8278, 8592}
local holeId = {
	294, 369, 370, 383, 392,
	408, 409, 427, 428, 430,
	462, 469, 470, 482, 484,
	485, 489, 924, 3135, 3136,
	7933, 7938, 8170, 8286, 8285,
	8284, 8281, 8280, 8279, 8277,
	8276, 8323, 8380, 8567, 8585,
	8596, 8595, 8249, 8250, 8251,
	8252, 8253, 8254, 8255, 8256,
	8972, 9606, 9625
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if(toPosition.x == CONTAINER_POSITION) then
		doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
		return true
	end
	toPosition.stackpos = 0
	local itemGround = getThingFromPos(toPosition)
	if(isInArray(spotId, itemGround.itemid)) then
		doTeleportThing(cid, {x = toPosition.x, y = toPosition.y + 1, z = toPosition.z - 1}, false)
	elseif(isInArray(holeId, itemEx.itemid)) then
		local hole = getThingFromPos({x = toPosition.x, y = toPosition.y, z = toPosition.z + 1, stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE})
		if(hole.itemid > 0) then
			doTeleportThing(hole.uid, {x = toPosition.x, y = toPosition.y + 1, z = toPosition.z}, false)
		else
			doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
		end
	else
		return false
	end

	return true
end
 
Code:
local spotId = {384, 418, 8278, 8592}
local holeId = {
	294, 369, 370, 383, 392,
	408, 409, 427, 428, 430,
	462, 469, 470, 482, 484,
	485, 489, 924, 3135, 3136,
	7933, 7938, 8170, 8286, 8285,
	8284, 8281, 8280, 8279, 8277,
	8276, 8323, 8380, 8567, 8585,
	8596, 8595, 8249, 8250, 8251,
	8252, 8253, 8254, 8255, 8256,
	8972, 9606, 9625
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if(toPosition.x == CONTAINER_POSITION) then
		doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
		return true
	end
	
	local found = false
	for _, i in ipairs(spotId) do
		if(getTileItemById(toPosition, i).uid > 0) then
			found = true
			break
		end
	end
	if(found) then
		doTeleportThing(cid, {x = toPosition.x, y = toPosition.y + 1, z = toPosition.z - 1}, false)
	elseif(isInArray(holeId, itemEx.itemid)) then
		local hole = getThingFromPos({x = toPosition.x, y = toPosition.y, z = toPosition.z + 1, stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE})
		if(hole.itemid > 0) then
			doTeleportThing(hole.uid, {x = toPosition.x, y = toPosition.y + 1, z = toPosition.z}, false)
		else
			doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
		end
	else
		return false
	end

	return true
end
 
Back
Top