Hi thxs for the code guys

awesome.
Prozail yours works very well. Although the cloud does not hit the party as intended, but still awesome man

I tried your code Doridion, but it crashed. At least it works thxs.
Now I have the following:
Spider egg: Poison cloud. (thxs to you guys).
Spider egg: Spawns a big spider onDie
Spider egg: Spawns those cute little spiders running around.
Barrels that give random food: Here is the code it works, but the food is spawned in one position (0) I would like the food to spawn in all 4 directions eg 0 ,1,2,3. I know it's not the best code, I am not good at coding thattts why I ask questions lol. I am going to make more barrels that spawn othere items eg: bullets etc..
Code: Select all
defineObject{
name = "breakable_food_barrel",
baseObject = "barrel_crate_block",
components = {
{
class = "Health",
health = 15,
onDie = function(self)
local foodList = {"ice_lizard_steak", "baked_maggot", "boiled_beetle", "rat_shank", "pitroot_bread", "herder_cap"}
local many = math.random(1, 4)
local facing = (party.facing + 2)%4
for i = 1, many do
spawn(foodList[math.random(1, #foodList)], self.go.level, self.go.x, self.go.y, 0, self.go.elevation)
end
end
}
}
}