Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How to create a Global Color3 Value?

I have a two scripts, one is a localscript, the other is not. The variable _G.Colour is currently a string of 255, 0, 0. When I try and alter the colour, using the code: (nothing is wrong with the code, trust me)

TextLabel.TextColor3 = ChatColour.Name

It returns the error bad argument #3 to 'TextColor3' (Color3 expected, got string)

5 comments

0

It must be a color3 value, not a string

0

How to I create a Color3 Global Variable?

0

why do you need it to be global

0

So that I can access it from a LocalScript, basically the server chooses a colour for the player (in a script) and the localscript turns a text label that colour.

1 answer

_G values are not to be used between server-client. Your best bet is to make a Color3Value in ReplicatedStorage. You can insert this from the explorer.

But if the color is going to be different for each player, you should use a Remote Event.

Your actual code is wrong because TextColor3 requires a Color3 object, not a string; I think the error is clear. Some things like Enum can simply use strings. Not this.

This discussion is preserved as it was. New answers, comments, and votes are closed.