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

How to create a function to set the part color?

Asked by 5 years ago
Edited 5 years ago

Hey! I have a problem. I want to create a function that sets the color I choose

local province = game.Workspace.province1
local provColor = province.ProvColor.Value 
function setColor (colorName) 
         provColor = colorName
         province.BrickColor.Color = BrickColor.provColor()
end
setColor(Dark blue)

But I have this error

Workspace.province1.Script:5: ')' expected near 'blue'

What have I done wrong?

1 answer

Log in to vote
1
Answered by
Y_VRN 246 Moderation Voter
5 years ago
Edited 5 years ago

Sorry I deleted the last post because it's kinda messy.

Here's the code:

local province = game.Workspace.province1
local provColor = province.ProvColor.Value 
function setColor (colorName) 
         provColor = colorName
         province.BrickColor = BrickColor.new(provColor)
end
setColor("Dark blue") -- Use strings

Again, sorry. But you're welcome.

0
Thanks You!~ Marerjha 0 — 5y
0
You're welcome! You can mark my answer. Y_VRN 246 — 5y
Ad

Answer this question