I tried to make a keycode script by upon pressing shift a running sound will play and all the other players will hear it. I'm not sure if i need to extend this question.
local script
local uis = game:GetService("UserInputService") local playsound = game.ReplicatedStorage.PlaySound--make a remote event named PlaySound local play = true uis.InputBegan:Connect(function(input,process) if process then return end if input.KeyCode == Enum.KeyCode.Shift then play = true playsound:FireServer(play) end) uis.InputEnded:Connect(function(in) if in.KeyCode == Enum.KeyCode.Shift then play = false playsound:FireServer(play) end)
server script:
local playsound = game.ReplicatedStorage.PlaySound local sound = game.ReplicatedStorage.Dababy -- your music sound.Looped = false playsound.OnServerEvent:Connect(function(plr,bool) if not sound.IsLoaded then sound.Loaded:Wait() end if bool then sound:Play() elseif bool == false then sound:Stop() end end)