Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why Doesn't Work?

Asked by 10 years ago
1Part = script.Parent
2 
3function Touced
4    Part.BrickColor = BrickColor.new("Really black")
5end

2 answers

Log in to vote
1
Answered by
emite1000 335 Moderation Voter
10 years ago

Were you trying to make it so the brick changed color on touch? If so, then you need to add an event listener, so that the script knows when to run (when it is touched).

1Part = script.Parent
2 
3function Touched()
4    Part.BrickColor = BrickColor.new("Really black")
5end
6Part.Touched:connect(Touched)
Ad
Log in to vote
-2
Answered by 10 years ago

You forgot to add parentheses after the function.

1Part = script.Parent
2 
3function Touced() -- This is the problem
4    Part.BrickColor = BrickColor.new("Really black")
5end
6 
7Touced() -- If you want it to make this part black when you start up the game

Answer this question