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

BrickColor not working properly?

Asked by
Dom2d2 35
10 years ago

Hey, I'm having a small issue.

This (Snippet from larger script):

    color = math.random(1,64)
    p.Color = BrickColor.new(color)

This is the error I get, how can i get this to work?

21:26:50.081 - Workspace.Script:7: bad argument #3 to 'Color' (Color3 expected, got userdata)

0
Is p happen to be a Gui? Sublimus 992 — 10y
0
p is a "Part", so no. Dom2d2 35 — 10y

1 answer

Log in to vote
1
Answered by
Sublimus 992 Moderation Voter
10 years ago

Part's have BrickColor not Color so it should be:

p.BrickColor = BrickColor.new(color)
Ad

Answer this question