germanny wrote:Forgot to paste the 'end' parts^^Code: Select all
for i in entitiesAt(place.level,place.x,place.y) do if i.name == "that_item" then hudPrint("Your item is found: "..i.name) else return false end end
No problem XD
germanny wrote:Forgot to paste the 'end' parts^^Code: Select all
for i in entitiesAt(place.level,place.x,place.y) do if i.name == "that_item" then hudPrint("Your item is found: "..i.name) else return false end end
Code: Select all
function checkPoison()
for i in mouth_socket_poison_1:containedItems() do
if i.name == "potion_poison"
then
playSound("consume_potion")
timer_poison_door:activate()
setMouseItem(spawn("flask"))
-- containedItems:destroy()
return
end
end
end
Code: Select all
function CheckPlantAlcove()
for alcoveItem in plantAlcove:containedItems() do
print (alcoveItem.name)
end
if containsItems(plantAlcove, "cave_nettle")
and containsItems(plantAlcove, "tar_bead")
and containsItems(plantAlcove, "slime_bell")
and containsItems(plantAlcove, "blooddrop_blossom")
and containsItems(plantAlcove, "grim_cap")
and containsItems(plantAlcove, "milkreed")
then
plantDoor:open()
plantSecret:activate()
else
plantDoor:close()
end
end
function containsItems(entity, item)
for i in entity:containedItems() do
if i.name == item then
return true
end
end
-- if we get here the item was not found
return false
end