I'm working on a strategy game called Solid. You find a secret door that leads to a deadly fire pit, but before you die, the screen turns black. But in the output it says...
21:45:02.089 - PlayerGui is not a valid member of Part 21:45:02.090 - Script 'Workspace.Teleporter.Script', Line 3 21:45:02.090 - Stack End
Here's the script.
script.Parent.Touched:connect(function(player)
game.Workspace.ScarySound1:Play()
player.PlayerGui.Gui.BlackScreen.Visible = true
end)
player.PlayerGui did work in a different script. (Not a localscript) Doing it the same way.

1 comment
I edited it a bit, and it worked. It didn't need to be under or in a localscript. Thanks bro.