Code: Select all
cloneObject{
name = "dungeon_destructible_cave_in",
baseObject = "dungeon_cave_in", -- you might want to change this to temple_cave_in or other. --
brokenModel = "assets/models/env/floor_dirt.fbx",
health = 50, -- adjust this to your needs. --
evasion = -1000,
hitEffect = "hit_dust",
hitSound = "impact_blade",
onProjectileHit = function()
return false -- projectiles (arrows and such) shouldn't be able to destroy it. --
end,
onHit = false, -- this is used to negate the "indestructible" property. --
onDie = function(self)
-- when blockage is destroyed, spawn 1-4 rocks. --
rocks = math.random(1,4)+1
for i = 1,rocks do
spawn("rock", self.level, self.x, self.y, i%4)
party:shakeCamera(0.8,0.8)
playSound("wall_sliding_lock")
end
end
}
