Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
0

How to create a function to set the part color?

Asked by 6 days ago
Edited 6 days 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 16
6 days ago
Edited 6 days 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 — 6d
0
You're welcome! You can mark my answer. Y_VRN 16 — 6d
Ad

Answer this question