I'm simply defining variables, and this error appears:
ScreenGui is not a valid member of PlayerGui, Line 1
here is the code
local blue = game.Players.LocalPlayer.PlayerGui.ScreenGui.Frame.Blue
local red = game.Players.LocalPlayer.PlayerGui.ScreenGui.Frame.Red
local player = game.Players.LocalPlayer

3 comments
Is this a Script or a LocalScript?
Localscript
Maybe you can try game.Players.LocalPlayer.PlayerGui:WaitForChild("ScreenGui").Frame.Blue?