New: Nitro Boost our Discord server and receive full donation perks here on the website! Join the Scripting Helpers Discord Server to learn more! You can also Support on Patreon as always.
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 1 year ago
Edited 1 year 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 91
1 year ago
Edited 1 year 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 — 1y
0
You're welcome! You can mark my answer. Y_VRN 91 — 1y
Ad

Answer this question