So I have a Model of a couple of bricks and I want the script to add explosions to every brick but randomly and with a random time. I have tried to do it but it wont work. Here is what I have :
local g = script.Parent.Parent.Fire:GetChildren()
for i = 1, #g do
local f = Instance.new("Explosion", script.Parent)
f.Position = i[g]
f.BlastPressure = 0
f.BlastRadius = 20
local s = script.Parent.Explosion2
s:Play()
wait(math.random(1,3))
end
end
end
Output: Workspace.Model.Model.Script:4: attempt to index local 'i' (a number value)
