"UITheme is not a valid member of Enum"

When attempting to use Enum.UITheme.Dark or Enum.UITheme.Light, I will just get a console error instead of it functioning like normal.

image

The Enum exists in autocomplete, and the docs, so it exists, it just seems to be crashing my code.

1 Like

I don’t actually know anything about this Enum so I think this can only be ran from a local script - I think UITheme is not available on scripts or something like that

1 Like

It seems to work fine both on the client and server in Studio, but not an actual game server.

1 Like

UITheme is only for uses in studio themes. Not sure why you are using it here

I’m using it to be cleaner than just a string which reads “Dark” or “Light” in a config file.

I see wheee you’re coming from, if it only works in studio then It only works in studio. I suggest you mark someone as a solution and find a different way.

1 Like

That makes it still an issue, at least it should be removed from autocomplete if it’s not going to be used in the actual client.

To what values are you setting these Enums to? This Enum shouldn’t be used outside of Studio

1 Like

As I said, just a cleaner way to write dark and light instead of strings.
image

and
image
vs
image

Intellisense doesn’t know if the script is going to turn into a plugin, so this isn’t possible. You could make your own enum like this:

local Theme = {
    Dark = 0,
    Light = 1,
}

print(Theme.Dark) --> 0

UITheme is only accessible in Studio. I suppose it is possible to hide it in LocalScripts/RunContext=Client, but this is intentional behavior.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.