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
11 years ago

Hey, I'm having a small issue.

This (Snippet from larger script):

1color = math.random(1,64)
2p.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 — 11y
0
p is a "Part", so no. Dom2d2 35 — 11y

1 answer

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

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

1p.BrickColor = BrickColor.new(color)
Ad

Answer this question