I started working on a music script for my game, keep in mind it’s a serverside script in ServerScriptService.
The script has no errors but it doesn’t actually play the sound?
spawn(function()
wait(5)
while wait() do
local Music = ReplicatedStorage.Audio.Ambience:GetChildren();
local RandomMusic = Music[math.random(1, #Music)]; wait();
RandomMusic.Playing = true
RemoteEvent:FireAllClients("Music", RandomMusic.Name);
wait(RandomMusic.TimeLength);
end;
end);
I have the wait() there because for some reason in Studio I die instantly as I spawn and for some reason the script gets messed up? I’m 100% sure it’s a Roblox bug.
The RemoteEvent just updates PlayerGui.