Changeable frame (server script) doesn't work unless its in a local script

if workspace.Configuration.ChangeTheme.Value == script.Parent.Name then
	script.Parent.Visible = true
else 
	script.Parent.Visible = false
end

workspace.Configuration.ChangeTheme.Changed:Connect(function()
	if workspace.Configuration.ChangeTheme.Value == script.Parent.Name then
		script.Parent.Visible = true
	else script.Parent.Visible = false
	end
end)

This script is for changing the theme of a frame known as a scoreboard. The script before would work as a serverscript but now it doesn’t unless I put it in a local script were only the client sees the changed theme.

1 Like

where do you parent server script? workspace? or maybe somewhere else???

1 Like

In the screengui. The value is in the workspace.configuration and the script is in the screengui

1 Like

in that case it shouldnt work because ScreenGui doesnt have Visible property

just change script.Parent.Visible to script.Parent.Enabled

1 Like

? the script is the frame… I just told you its to change a theme

1 Like

whaaaaaaaat but you said that script is in screengui?? like right there

and the script is in the screengui

1 Like

I meant the script is in the screengui in the frame

1 Like

where do you change that value

on localscript or on serverscript?

1 Like

to change the value, I use a serverscript in a menu.
To change the frames, I used a serverscript in the frames

1 Like

not tested …

in ServerScriptService

local objectToToggle = game.Workspace.YourObjectNameHere -- name of the object you want to toggle

game.Workspace.Configuration.ChangeTheme.Changed:Connect(function()
    local desiredTheme = objectToToggle.Name -- desired theme
    
    if game.Workspace.Configuration.ChangeTheme.Value == desiredTheme then
        objectToToggle.Visible = true
    else
        objectToToggle.Visible = false
    end
end)

where is screengui parented? PlayerGui? or maybe somewhere else

1 Like

Its not in workspace it is in the players playergui