1st Box: When I have this script run I get this message " ServerScriptService.Script:2: attempt to index field 'PlayerGui' (a nil value)". Also how to access the PlayerGui with scripts? I am unsure of what this means and how to do this. I have tried rerouting it to StarterGUI and it works (I'm asking about this so I can learn).
1st Box
game.Players.PlayerAdded:Connect(function(player)
wait(1)
game.Players.player.Name.PlayerGui.EnterGui.TextLabel.Text = " " ..player.Name.. " has joined the game"
wait(5)
script.Parent.PlayerGui.EnterGUI.TextLabel.Text = " "
end)
--This is my code for Players
2nd Box: It does work for StarterGui but that brings me to my next problem. I want it to remove the message after a wait, as shown in the Second box of code below, and that doesn't work as well. No error code appears and I am unsure as to what is wrong. Can you help with this. Thanks!
2nd Box
game.Players.PlayerAdded:Connect(function(player)
wait(1)
game.StarterGui.EnterGui.TextLabel.Text = " " ..player.Name.. "has joined the game"
wait(5)
game.StarterGui.EnterGUI.TextLabel.Text = " "
end)
--This is my code for StarterGui

1 comment
Both answers demonstrate your problems, but if you have FE on the server cannot access the PlayerGui