I am making a zombie game and it says GameScript is not a valid member of StarterGui and I need help on how to solve this here is the script.

if game.StarterGui.Main.Parent.GameScript.Teleport.Value == true then  -- This is problem
		script.CamFix.Disabled = false
		script.Parent.Parent.Playing.Value = true
		game.StarterGui.Main.Parent.GameScript.StartPlayers.Value =  game.StarterGui.Main.Parent.GameScript.StartPlayers.Value + 1

3 comments

0

try if game.StarterGui:WaitForChild("Main").Parent.GameScript.Teleport.Value == true then

0

didnt work

0

You are doing game.StarterGui.Main.Parent. This will just return StarterGui. If it is under Main then remove .Parent and it should work