`` local MyFolder = game.Workspace.Assets.HouseParts
local MyTable = game.Workspace.Assets.HouseParts:GetChildren()
local function StartDemolishing()
for i, v in pairs(MyTable) do wait(3) v.Color = Color3.fromRGB(255, 52, 52) v.Material = "SmoothPlastic" wait(2) game.Workspace.Sounds.DestroySound:Play() print("Demolished") local explosion = Instance.new("Explosion", v) --The explosion doesn't appear? explosion.Parent = v explosion.Position = v.Position local sound = game.Workspace.Sounds.Explode sound:Play() v:Destroy() end
end
local button = game.Workspace.Button2.Button
button.ClickDetector.MouseClick:Connect(function()
button.Color = Color3.fromRGB(255, 0, 0) button.Material = "Neon" button.ClickDetector:Destroy() StartDemolishing()
end) ``
You trying to change the color of a model I see
it's either you're just making an error
Here is the code that worked for me
for i, v in pairs(workspace:GetChildren()) do if v:IsA("BasePart") then wait(3) v.Color = Color3.new(255/255, 52/255, 52/255) -- you can't use fromRGB on a part v.Material = "SmoothPlastic" wait(2) game.Workspace.Sounds.DestroySound:Play() print("Demolished") local explosion = Instance.new("Explosion", v) explosion.Parent = v explosion.Position = v.Position local sound = game.Workspace.Sounds.Explode sound:Play() v:Destroy() end end