I am working on an obby and I want to have a loading screen. I added a local script inside of the screen GUI of the loading screen and typed the code below. When I join the game however, the script does not function and there are no errors so I do not know what to fix. I realized when I removed the PlayerAdded function, my script ran perfectly. Is there any way that I can fix my PlayerAdded function so when the player joins, the loading screen will appear? Help is much appreciated and thank you in advanced.
local LS = script.Parent.LoadingScreenFrame
local MuteMusic = script.Parent.Parent.MuteMusic.MuteMusicFrame
local ShopButton = script.Parent.Parent.ShopGUI.ShopButton
local TeleportButton = script.Parent.Parent.TeleportGUI.TeleportButton
game.Players.PlayerAdded:Connect(function()
MuteMusic.Visible = false
ShopButton.Visible = false
TeleportButton.Visible = false
LS.Visible = true
end)
