one of the problems is that the specific item is one that i spawned using this code
Code: Select all
local twig = self.go:spawn("branch")
twig.item:setDescription("A small twig from a tree")
twig.item:setWeight(0.8)
twig.item:setUiName("Twig")
Code: Select all
function surfaceContains(surface, item)
for v,i in surface:contents() do
if i.go.name == item then return true
end
end
end
function openShieldDoor()
if surfaceContains(twig_chest.surface, "twig") then
tomb_door_portcullis_4.door:open()
else
tomb_door_portcullis_4.door:close()
end
end
Once i get this working, i just need to copy it 3 times for the other 3 doors&items and i'm about half way through completing my knightmare re-remake lol