So I have made a script that runs whenever a player joins my game a Screen Gui pops up on the screen with the players name(Label Text) and thumbnail picture (Image Label). The script is located in Workspace and for some reason the script doesn't work. The problem is that I have scripted the Text Label and the Image Label to be turned off after a couple of seconds and it doesn't turn off via the value "Enabled". Is "Enabled" a true or false value? I have exhausted all theories and theorems, I am not sure what to do. Any feedback is appreciated thank you. Here's the script:
local Players = game:GetService("Players")
-- ^ Gets Players
local Textlabel = game.StarterGui.PlayerJoin.TextLabel
--^ Text label location
local Picture = game.StarterGui.PlayerJoin.ImageLabel
--^ Image label location
local Screengui = game.StarterGui.PlayerJoin
--^ Screen gui location and gui that makes the image label and text label not visible or not enabled
Players.PlayerAdded:Connect(function(player)
--^ Function runs whenever a player joins the game or server
Screengui.Enabled = true
--^ Makes the Screengui visible
Textlabel.Text = player.Name.. " joined the game!"
--^ Text label that prints player name joined the game
wait(5)
--^ waits 5 seconds
print("I have waited 5 seconds!")
--^ Confirms that 5 seconds has passed
Screengui.Enabled = false
--^ Is supposed to make the screen Gui not enabled thus making the image label and
--text label not visible
end)
-- Code below displays message that player has left the game
Players.PlayerRemoving:Connect(function(player)
Textlabel.Visible = true
print(player.Name.. " has left the game!")
end)
Heres Pictures of Roblox Explorer: (https://ibb.co/znWGSvj)

5 comments
Hope you enjoyed I'm too slow for coding lol
You'd do (player, true)
NOT just (true), true is a key word, it's passed in a function or a parameter depending on the code, you would pass a true to turn something on,
Hi thank you for replying. I have tried this and it sadly does not work still. I made have the remote event and named it in replicated storage. I have made one regular script and placed it in the remote event newoldplayer. I have made the local script and placed it in my screengui so it is the parent of the local script. Sadly it still does not work I dont know why roblox has to be so complicated.
Its ok I'm beginner lol