Hi, I recently asked a question and it was solved here's the question if you want to see:
http://scriptinghelpers.org/questions/124584/animation-not-sure-how-to-add-sound-to-an-animation-any-suggestions
But I'm having a new issue where the sound can only be heard by the player. I still want the sound to be able to be played during an animation and have it so people around the player can hear it. Any help I can get is appreciated.
Here's the script so far:
wait(.5) Player = game.Players.LocalPlayer.Character animation1 = Player.Humanoid:LoadAnimation(script.Animation1) animation2 = Player.Humanoid:LoadAnimation(script.Animation2) animation3 = Player.Humanoid:LoadAnimation(script.Animation3) CanEmote = true game:GetService('UserInputService').InputBegan:Connect(function(Input, GameProcessed) if not GameProcessed and Input.KeyCode == Enum.KeyCode.P then local emote = math.random(1,3) if emote == 1 and CanEmote == true then Player:WaitForChild('Humanoid').JumpPower = 0 Player:WaitForChild('Humanoid').WalkSpeed = 0 script.Sound1:Play() animation1:Play() CanEmote=false wait(1) Player:WaitForChild('Humanoid').JumpPower = 50 Player:WaitForChild('Humanoid').WalkSpeed = 16 CanEmote=true elseif emote == 2 and CanEmote == true then Player:WaitForChild('Humanoid').JumpPower = 0 Player:WaitForChild('Humanoid').WalkSpeed = 0 script.Sound2:Play() animation2:Play() CanEmote=false wait(1) Player:WaitForChild('Humanoid').JumpPower = 50 Player:WaitForChild('Humanoid').WalkSpeed = 16 CanEmote=true elseif emote == 3 and CanEmote == true then Player:WaitForChild('Humanoid').JumpPower = 0 Player:WaitForChild('Humanoid').WalkSpeed = 0 script.Sound3:Play() animation3:Play() CanEmote=false wait(1.5) Player:WaitForChild('Humanoid').JumpPower = 50 Player:WaitForChild('Humanoid').WalkSpeed = 16 CanEmote=true end end end)
make a server script and parent it to that script's parent, basically the same location as the current script you're using and then paste this script inside the server script
wait(.5) Player = game.Players.LocalPlayer.Character animation1 = Player.Humanoid:LoadAnimation(script.Animation1) animation2 = Player.Humanoid:LoadAnimation(script.Animation2) animation3 = Player.Humanoid:LoadAnimation(script.Animation3) CanEmote = true game:GetService('UserInputService').InputBegan:Connect(function(Input, GameProcessed) if not GameProcessed and Input.KeyCode == Enum.KeyCode.P then local emote = math.random(1,3) if emote == 1 and CanEmote == true then Player:WaitForChild('Humanoid').JumpPower = 0 Player:WaitForChild('Humanoid').WalkSpeed = 0 script.Sound1:Play() animation1:Play() CanEmote=false wait(1) Player:WaitForChild('Humanoid').JumpPower = 50 Player:WaitForChild('Humanoid').WalkSpeed = 16 CanEmote=true elseif emote == 2 and CanEmote == true then Player:WaitForChild('Humanoid').JumpPower = 0 Player:WaitForChild('Humanoid').WalkSpeed = 0 script.Sound2:Play() animation2:Play() CanEmote=false wait(1) Player:WaitForChild('Humanoid').JumpPower = 50 Player:WaitForChild('Humanoid').WalkSpeed = 16 CanEmote=true elseif emote == 3 and CanEmote == true then Player:WaitForChild('Humanoid').JumpPower = 0 Player:WaitForChild('Humanoid').WalkSpeed = 0 script.Sound3:Play() animation3:Play() CanEmote=false wait(1.5) Player:WaitForChild('Humanoid').JumpPower = 50 Player:WaitForChild('Humanoid').WalkSpeed = 16 CanEmote=true end end end)