Part = script.Parent
function Touched()
Part.BrickColor = BrickColor.new("Really black")
end
How to Fix It? It Dosen't Change Black
4 answers
Part = script.Parent
function Touched()
Part.BrickColor = BrickColor.new("Really black")
end
Part.Touched:connect(Touched)
You forgot to put the object that connects to the function therefore making an error.
You seem to be new to functions, i suggest checking out http://wiki.roblox.com/index.php?title=Function for more information ^_^
The problem is that you have no event firing the function
Part = script.Parent
Part.Touched:connect(function()
Part.BrickColor = BrickColor.new("Really black")
end)
To be very clear: There is nothing special about the name Touched.
Your script defines a function, but nothing here causes that function to happen. The game doesn't know about your function yet, because you haven't told it.
You have to tell it about your function by connecting it to an event, probably the touched event:
Part.Touched:connect( Touched )
Note that the second Touched is just the name of your function -- which could be anything. Here, you're saying, "ROBLOX, please remember the function with the named Touched and whenever this event fires, call that function, Touched".
Without that line, nothing happens since there is nothing to cause the function to be called.
Maybe you should rename Part.
This discussion is preserved as it was. New answers, comments, and votes are closed.

4 comments
No.It dosen't Work
Does black have to be capitalized?
Yes.I've tried with and without.
Oh you did forget the bottom part of the function XD