I've been trying to make a 'Realistic' roblox game, but i can't seem to make or edit a roblox ragdoll script so it has impact sounds when the ragdoll falls on the ground or gets hit by something. It would be a huge help if someone could at least give me a suggestion on what to edit or where to start.
If you want the sound when the player gets hit by something, just use humanoid.Touched:Connect(function(hit)
or something around those lines and play the sound. You can use this to learn about 'Touched' and if you want a sound to play when the player falls down, you can use humanoid state type in order to get the state where they fall down and play the sound.You can check here for the Humanoid.FallingDown
and here to learn more about the humanoid state types also here to learn about getting the states of the humanoid
If you are trying to ragdoll with a button, for say, the button "G", use this code:
local s = Instance.new("Sound") s.Parent = player.Character.Torso s.SoundId = "rbxassetid://SOUNDHERE" -- put your sound id here s.Looped = false mouse.KeyDown:connect(function(key) If key == "g" then -- put the Ragdoll script here. s:Play() wait(2) -- cooldown so you cannot spam ragdoll or sounds end
Please tell me if this helped at all.