adrenyslopez
Member
- Joined
- Dec 22, 2015
- Messages
- 201
- Reaction score
- 15
Hello, I am using this script in my ot, it works but when you click when you are standing at the door, another door appears and the door is changed to another, here I leave a video
i used otbr tfs 1.3
scripts.lua
i used otbr tfs 1.3
scripts.lua
Lua:
local function hasAllStorages(player)
local storageKeys = {
Storage.GraveDanger.CobraBastion.DukeKill,
Storage.GraveDanger.CobraBastion.LordKill,
Storage.GraveDanger.CobraBastion.TwinsKill,
Storage.GraveDanger.CobraBastion.VlarkKill,
Storage.GraveDanger.CobraBastion.EarlKill
}
for _, storageKey in pairs(storageKeys) do
if player:getStorageValue(storageKey) <= 0 then
return false
end
end
return true
end
local hauntedhoused = Action()
function hauntedhoused.onUse(player, item, fromPosition, target, toPosition, isHotkey)
if not hasAllStorages(player) then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You need to kill all bosses of Grave Danger Quest to pass.")
return true
end
if item.itemid == 1225 then
player:teleportTo(toPosition, true)
item:transform(item.itemid + 1)
elseif item.itemid == 1226 then
if Creature.checkCreatureInsideDoor(player, toPosition) then
return true
end
item:transform(item.itemid - 1)
end
return true
end
hauntedhoused:aid(23151)
hauntedhoused:register()