1 - This is a script that opens a door when 2 torches are put into 2 torch holders. It wont run and comes up with the error
(attempt to call method 'hasTorch' (a nil value)
Code: Select all
function DoorOpen1()
if torch_holder_12:hasTorch() == true and
torch_holder_13:hasTorch() == true then
dungeon_door_wooden_4:open()
else
dungeon_door_wooden_4:close()
end
endCode: Select all
function PrisonLocks()
playSound("secret")
prison_lock = prison_lock + 1
if prison_lock==1 then
hudPrint("First lock unlocked.")
elseif prison_lock==2 then
hudPrint("Second lock unlocked.")
findEntity("dungeon_door_wooden_2"):open()
hudPrint("Prison Mines are now accessable")
hudPrint("")
end
endThe error it comes up with is (attempt to call method 'getItemCount' (a nil value)
Code: Select all
function checkDoor1(self)
local alcove = findEntity("altar_1")
if (alcove ~= nil)and(alcove:getItemCount()>0) then
local item for item in alcove:containedItems() do
if item.name == "rock" then
--- Destroy Items here ---
self:destroy() -- This will Destroy the LOCK REM THIS --
item:destroy() -- Destroy the Key --
-- HudPrints Here and Key lock Sound and Fx's --
hudPrint("Yes the Yuanti Dagger is mine.")
party:shakeCamera(1,1)
dungeon_door_wooden_1:open()
else
hudPrint("")
end
end
end
endOh and by the way Thank you to Almost Human for a awesome new Editor, good job guys I love it very much, thxs to Skuggs for the videos. I have learnt heaps from them
