When you touch the scripts parent, a object in the workspace should change color and then unanchor and create an explosion. It cant get to the explosion because it won't change color. How do I make it change color?
script.Parent.Touched:Connect(function() script.Parent.Parent.Parent.Parent.ff.BrickColor(255,0,0) wait(3) script.Parent.Parent.Parent.Parent.ff.Anchored = false local explosion = Instance.new("Explosion") explosion.Position = script.Parent.Parent.Parent.Parent.ff.Position explosion.Parent = game.Workspace end)
You aren't using BrickColor correctly. You should be using BrickColor.new
, but in this case you want RGB. You should use Color3.fromRGB
instead.
Code example:
script.Parent.Touched:Connect(function() script.Parent.Parent.Parent.Parent.ff.Color = Color3.fromRGB(255,0,0) wait(3) script.Parent.Parent.Parent.Parent.ff.Anchored = false local explosion = Instance.new("Explosion") explosion.Position = script.Parent.Parent.Parent.Parent.ff.Position explosion.Parent = game.Workspace end)
This code has not been tested prior to response there may be other issues covered by other answers.
Hope this helps!