Making a theme script; runs on local

I am working on an admin panel, I am adding custom themes, but anyone can pick a theme via the settings gui, I have tried this:

local player = game.Players.LocalPlayer

function GetTheme ()
	
	
	print("Getting Theme: Venture")
	
	
if player.PlayerScripts:WaitForChild("VentureTheme").Value == "Light" then
	return "Light"
elseif player.PlayerScripts:WaitForChild("VentureTheme").Value == "Dark" then
	return "Dark"
	elseif player.PlayerScripts:WaitForChild("VentureTheme").Value == "" then
	print("Venture: Failed to load Theme. Using Light Mode.")
	return "Light"
	end
end

Feel free to help with this, thanks!

1 Like

I suggest changing the value on the server as it can be saved using a DataStore. Is there any problem or…?

The script didn’t work at all, I don’t know how to use Datastores’ my developer does. I’ll try asking them. How would I make it multi-theme though?

You could try this on the server (bad mobile format):

function getTheme(plr)
    local Theme = plr.PlayerScripts.VentureTheme
    if Theme.Value == "" then
        return "Light"
    else
        return Theme.Value
    end
end

どうもありがとう!これは一時的なオプションとして使用されます。