How to make sound play after the player closes the game

Hey, I’ve stumbled upon this game:

And I couldn’t help but notice that a message plays even though I already left the game.
How’s that possible? I’ve tried replicating it with stuff like game.Close but it just won’t work.

1 Like

Have you tried something like:

--in LocalScript
game:GetService("Players").PlayerRemoving:Connect(function()

     sound:Play()

end)

?

Yeah I’ve tried it just now and I can hear the sound play but only for a split second before it gets cut off because of the game closing

1 Like

And in server? Like, creating a script in server that sends a message (by a RemoteEvent) to client to play the sound?

That takes too long tbh even though its under a second

1 Like

You’d need to have more of the sound loaded before they leave, so if I was you id preload async to preload the audio and then play it as they leave so more of the audio is playing when they leave

you can make it with game.Players.PlayerRemoving
but the player that leaved canot hear that music obv because he leaved but other players can

I’ve tried preloading the sound but with the same result of a cut off sound and not playing till the end.

I’ve tried playing it with a remote event as well and I didn’t hear anything actually compared to just checking for the player leaving directly from a local script

Hey i just tested it, and the sound actually played, the entire audio, this is really cool

How did you get the audio to play fully? (nevermind I read that wrong maybe you meant the game I linked)