I have been working on a spectate UI and I only want to make it appear when your not in-game, but I get this error at line 10: ServerStorage is not a valid member of Player. Can someone please help me.

local player = game.Players.LocalPlayer
local SpectateButton = script.Parent.Spectate
local Intro = script.Parent.Parent.MainGUI.Intro

while wait() do
if not player:FindFirstChild("Contestant") then
	if Intro.Visible == false then
	SpectateButton.Visible = true
	
	if script.Parent.Parent.Parent.ServerStorage.GameValues.GameInProgress.Value == true then
		SpectateButton.Visible = false
	
	if script.Parent.Parent.Parent.ServerStorage.GameValues.GameInProgress.Value == false then
		SpectateButton.Visible = true
		
	if Intro.Visible == true then
		SpectateButton.Visible = false
					end			
				end	
			end
		end
	end
end

2 comments

0

You can not access serverstorage through a local script. You will need to put the items in replicatedstorage or find another work-around

1

oh ok thanks :)