Kiy4ku’s Ragdoll Service
Features
Temporary Ragdoll "You can create temporary & permament ragdolls as you wish with Ragdoll Count extension without overwriting's."
Custom Constraints "You don't have to use only the constraints provided by the service, you can create and use your own constraint info table."
Easy To Use "Simple and elegant."
Lightweight "It doesn't include loops expect detecting character loaded in client side."
Configurable "You can configure it as you wish by changing the values in the constants module inside the service."
Not Complex Framework "The framework of module is not spaghetti and understandable if you want to make your own adjustments you can do it easily."
Compatible With NPCs "Compatible With NPCs"
Overwrite test for temp ragdoll’s:
Test with camera spring:
Usage
- If you want ragdoll a character just add
'Ragdoll'
Tag to Humanoid (it’ll auto add’s Ragdollable Tag too) - If you want rig a character before ragdoll just add
'Ragdollable'
Tag to Humanoid - If you want ragdoll character on humanoid died just add
'RagdollOnHumanoidDied'
Tag to Humanoid
Configuration
- Find constants module in Ragdoll Service
And configure values as you want.
Temporary Ragdolls
- Import this asset to your game and use methods inside of module instead of directly giving tags to humanoid’s (if you don’t understand you can check the demo place’s)
https://create.roblox.com/store/asset/134470806038046/RagdollServiceTempExtension - Simple Usage;
local tempRagdollExtension = require(script.ragdollServiceTempExtension)
tempRagdollExtension:Ragdoll(targetCharacter) -- Ragdoll's the character
task.delay(5, function() -- Wait's 5 second without yielding the rest of the script
if targetCharacter then -- Check's targetCharacter for detect still not destroyed
tempRagdollExtension:Unragdoll(targetCharacter) -- Unragdoll's targetCharacter
end
end)
Information
-
If you ragdoll something and the ragdolled thing has a humanoid, i.e. is a character, don’t forget to do Humanoid:ChangeState(Enum.HumanoidStateType.Physics).
-
When a player dies, you can set player.Character = nil from the server, then delete the character. On the client side, you can clone the character at the moment it’s being deleted, enabling you to ragdoll the character without any problem. (To prevent freezing.)
-
The module detects the last word of the joints and accordingly, creates folders in RagdollConstraints Folder for example: RightShoulder → Shoulder (The joint names in the ConstraintsInfo table should also be the last word of the joint.)
Examples
Constraints Info Example
Neck = {
NoCollisionConstraint = {},
BallSocketConstraint = {
LimitsEnabled = true,
TwistLimitsEnabled = true,
TwistLowerAngle = -40,
TwistUpperAngle = 40
}
},
Shoulder = {
NoCollisionConstraint = {},
BallSocketConstraint = {
UpperAngle = 20,
LimitsEnabled = true,
TwistLimitsEnabled = true,
TwistLowerAngle = -40,
TwistUpperAngle = 20
}
},
Waist = {
NoCollisionConstraint = {},
BallSocketConstraint = {
LimitsEnabled = true,
TwistLimitsEnabled = true,
TwistLowerAngle = -40,
TwistUpperAngle = 40
}
},
Elbow = {
WeldConstraint = {}
},
Wrist = {
NoCollisionConstraint = {},
BallSocketConstraint = {
UpperAngle = 15,
LimitsEnabled = true,
TwistLimitsEnabled = true,
TwistLowerAngle = -15,
TwistUpperAngle = 15
}
}
Init Ragdoll Service Server Example
require(game:GetService('ReplicatedStorage').RagdollService)
local players = game:GetService('Players')
players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
local humanoid = character:WaitForChild('Humanoid') :: Humanoid
humanoid:AddTag('Ragdollable')
humanoid:AddTag('RagdollOnHumanoidFall')
humanoid:AddTag('RagdollOnHumanoidDied')
end)
end)
game:GetService('ReplicatedStorage').Remote.OnServerEvent:Connect(function(player)
if player.Character then
if player.Character.Humanoid:HasTag('Ragdoll') then
player.Character.Humanoid:RemoveTag('Ragdoll')
else
player.Character.Humanoid:AddTag('Ragdoll')
end
end
end)
Init Ragdoll Service Client Example
require(game:GetService('ReplicatedStorage').RagdollService)
local userInputService = game:GetService('UserInputService')
local remote = game:GetService('ReplicatedStorage').Remote
userInputService.InputBegan:Connect(function(input: InputObject, gameProcessedEvent: boolean)
if input.KeyCode == Enum.KeyCode.R then
remote:FireServer()
end
end)
Demo Places
Information About RENDER_PLAYER_CHARACTERS_ON_CLIENT_AFTER_DIED
- When a player dies, service set’s player.Character = nil from the server, then delete’s the character. On the client side, service clone’s the character at the moment it’s being deleted, enabling you to ragdoll the character without any problem. (To prevent freezing)
Info
If you want you can publish it in wally or another package manager as you wish, i no have time for that.
Thanks to @Quenty (i inspired cameraspring system from nevermore engine)