Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

ServerStorage is not a valid member of Player?

Asked by 4 years ago

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
0
You can not access serverstorage through a local script. You will need to put the items in replicatedstorage or find another work-around DarkDanny04 407 — 4y
1
oh ok thanks :) coreyhsGames 5 — 4y

Answer this question