Code: Select all
-- plate lever toggle
function platetoggle()
mylever:toggle()
end
Code: Select all
-- do something special script
function leveraction()
if mylever:getLeverState() == "activated" then
superdoor:open()
else
superdoor:close()
end
end
Code: Select all
function gamble()
if checkContents(alcove_bet, "torch_everburning") then
if math.random(100) < math.random(90) then
hudPrint("You Win")
playSound("level_up")
alcove_win:addItem(spawn("boots_valor"))
else
hudPrint("You lose")
spawn("poison_cloud", party.level, party.x, party.y, 0)
end
end
lever_gamble:setLeverState("deactivated")
end
function checkContents(location,item)
for object in location:containedItems() do
-- if you want to show the name of items you actually put in the alcove
-- then uncomment the hudPrint below
-- hudPrint(object.name)
if object.name == item then
--remove object (but havent worked out how yet!)
return true
end
end
return false
end