I want to make a jumping sound effect that only plays the sound when a specific player jumps. I need it to be audible to all of the other players so Im not sure how to do that. The specific player will have a boolvalue inside of them that when set to true is the selected player. Idk if that makes sense
1 Like
Do something like this:
player.Character.Humanoid:GetPropertyChangedSignal("Jump"):Connect(function()
if player.Character.Humanoid.Jump == true then
if boolvalue.Value == true then
sound:Play()
end
end
end)
1 Like
---Services
local UserInputService = game:GetService("UserInputService")
local Player_Service = game:GetService("Players")
---Jump Sound
local Player = Player_Service.LocalPlayer
local Character = Player.Character
local Humanoid: Humanoid = Character.Humanoid
local PlayJumpSound = Character.PlayJumpSound
if PlayJumpSound.Value then
UserInputService.JumpRequest:Connect(function()
if Humanoid.FloorMaterial == Enum.Material.Air then return end
if Character.JumpSound.IsPlaying then return end
Character.JumpSound:Play()
end)
end
1 Like
Iād recommend just grabbing the CharacterSounds script that roblox creates for you
And modify the script, changing the sound id based on if the player has the BoolValue in their Character.
1 Like