Haii!
I'm currently trying to make an music player script, which I got done but now when I tried to test it online (on a ROBLOX place), it didin't work. But on ROBLOX Studio, it works perfectly fine.
Here's the script:
while wait(1) do
game.Players.PlayerAdded:Connect(function(player)
end)
local NowPlaying = script.Parent.Parent.TextLabel
local Sound = script.Parent.Parent.SongPlayer
print("The music player has loaded!")
wait(1)
Sound.SoundId = 'rbxassetid://1051512943'
NowPlaying.Text = 'Running in the OOFs'
script.Parent.Parent.SongPlayer:Play()
script.Parent.Parent.SongPlayer.Ended:Wait()
end
:)

3 comments
Remove game.Players.PlayerAdded:Connect(function(player) end) from the loop in while wait(1) do.
Don't use wait(1) as a condition.
What I'm about to say might seem dumb, but it's also a fact. Some things only work in Roblox Studio, but do nothing in a regular game.