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
    Part = script.Parent

    function Touced
        Part.BrickColor = BrickColor.new("Really black")
    end

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).

Part = script.Parent

function Touched()
    Part.BrickColor = BrickColor.new("Really black")
end
Part.Touched:connect(Touched)
Ad
Log in to vote
-2
Answered by 10 years ago

You forgot to add parentheses after the function.

Part = script.Parent

function Touced() -- This is the problem
    Part.BrickColor = BrickColor.new("Really black")
end

Touced() -- If you want it to make this part black when you start up the game

Answer this question