yoiker
Member
- Joined
- Jan 21, 2012
- Messages
- 194
- Solutions
- 1
- Reaction score
- 9
Thank you in advance for taking the time to read this post. Perhaps most prefer the opposite of what I want in this case.
I would like that when using the ladder if there is a magic wall or wild growth rune up blocking the step where it will fall the function will not be executed.
Important: if one of the magic wall rune or wild growth rune disappears, they can use the ladder.
SOLVED!
I would like that when using the ladder if there is a magic wall or wild growth rune up blocking the step where it will fall the function will not be executed.
Important: if one of the magic wall rune or wild growth rune disappears, they can use the ladder.
Code:
local upFloorIds = {1386, 3678, 5543, 22845, 22846}
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
local tile = item:getTile()
if tile and tile:hasFlag(TILESTATE_PROTECTIONZONE) and player:isPzLocked() then
return false
end
if isInArray(upFloorIds, item.itemid) then
fromPosition:moveUpstairs()
else
fromPosition.z = fromPosition.z + 1
end
player:teleportTo(fromPosition, false)
return true
end
SOLVED!
Last edited: