Basically, I'm making a round based PVP game, and i'm trying to make it so when the game starts, the music changes , and in the server script, (where it plays the music) it will fire a remote event to the client, but im getting an error: FireClient() argument must be a player object. Help would be appreciated.
Here is the 1st script: (server script)
local player = game.Players.LocalPlayer --I skipped to the part where it plays the music game.ReplicatedStorage.startMusic:FireClient()
2nd script: (Local script)
game.ReplicatedStorage.startMusic.OnClientEvent:Connect(function() game.Workspace.Music.Lobby:Stop() game.Workspace.Music.Game1:Play() end
LocalPlayer can only be accessed via the client (LocalScript). The only two solutions I'm seeing are:
A. You fire from the client to the server, do whatever you want it to do, and then back to the client to stop the music.
B. Add a wait() in the LocalScript and then Stop()/Play() those sound objects.
I'm still confused as to why you're stopping and playing music on the client when you could play them on the server.