Do not use this module it is designed to not work.
A main issue I’m having I realized I wasn’t using your ragdoll for players because it doesn’t work.
It just says RagdollStructure for this character doesn’t exist and the character is not yet ready for RagdollStructure creation. (x42) - Server - RagdollEaseOfUse:70
It’s just a regular character… It works with non player characters.
I set it up like this IDK if the script is not registering new characters properly
This is the test snippet for the client sided script as well as a handler for the ragdoll signal.
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RagdollSystem = require(ReplicatedStorage.RagdollSystemPackage.RagdollSystem)
local RagdollDefaultRemoteEventSystemClientUtility = RagdollSystem .RagdollDefaultRemoteEventSystemClientUtility
print("Active")
RagdollSystem.initialize()
RagdollDefaultRemoteEventSystemClientUtility.setUpServerClientCommunicationOnClient()
local Ragdoll = RagdollSystem.RagdollEaseOfUse
game.Players.LocalPlayer.CharacterAdded:Connect(function()
local c=nil
c=game.Players.LocalPlayer.PlayerGui.ragdoll.variables.ragdolltrigger:GetPropertyChangedSignal("Value"):connect(function()
if game.Players.LocalPlayer.PlayerGui.ragdoll.variables.ragdolltrigger.Value==true then
Ragdoll.stunCharacter(game.Players.LocalPlayer.Character)
else
Ragdoll.unstunCharacter(game.Players.LocalPlayer.Character)
end
end)
local dis=nil
dis=game.Players.LocalPlayer.CharacterRemoving:Once(function()
c:Disconnect()
dis:Disconnect()
end)
end)
This is my server side code.
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RagdollSystem = require(ReplicatedStorage.RagdollSystemPackage.RagdollSystem)
local RagdollDefaultRemoteEventSystemServerUtility = RagdollSystem .RagdollDefaultRemoteEventSystemServerUtility
RagdollSystem.initialize()
RagdollDefaultRemoteEventSystemServerUtility.setUpServerClientCommunicationOnServer()
This ragdoll system has given me nothing but headaches and the way it is coded is honestly frustrating and incomprehensible to understand how to debug it. Why can’t it just work. It blows my mind someone would code like this. Please fix your module properly and stop skipping over issues and returning an error.
I’ll be finding a different ragdoll module that is actually designed to work without it being loaded with bloat ware and from a developer who doesn’t code like he’s building a wall to keep everyone out. Literally you designed it to not work. real nice
function RagdollValidationOfDataFromUserDefinedFunctions.validateBodypartInstancesGivenByUserDefinedFunction(bodypartInstances: {BasePart | Model | Folder}, instanceHierarchyTopInstance: Model, ragdollCharacterSettings)
local functionForGettingInstancesToIgnore = RagdollSettingsUtility.getSettingFromEitherCharacterSettingsOrSystemSettings("functionToGetInitialInstancesToIgnoreForBodypartInstance", ragdollCharacterSettings, NetworkEnvironmentAccessibilityType.shared)
if #bodypartInstances == 0 then
error("no bodypart instances")
end
for _, bodypartInstance in bodypartInstances do
if typeof(bodypartInstance) ~= "Instance" or (not bodypartInstance:IsA("BasePart") and not bodypartInstance:IsA("Model") and not bodypartInstance:IsA("Folder")) then
error("Invalid bodypart instance")
end
-- I use :IsAncestorOf instead of IsDescendantOf here so that I get an error if bodypartInstance is somehow nil.
-- If I used bodypartInstance:isDescendantOf(instanceHierarchyTopInstance), it would return true
-- and thus the code would think that everything is fine.
if not instanceHierarchyTopInstance:IsAncestorOf(bodypartInstance) then
error("All bodypart instances must be descendants of instance hierarchy top instance.")
end
for _, otherBodypartInstance in bodypartInstances do
-- no need to skip iteration when otherBodypartInstance == bodypartInstance
-- because otherBodypartInstance:IsDescendantOf(bodypartInstance) will return false in that case.
if otherBodypartInstance:IsDescendantOf(bodypartInstance) then
error("Bodypart instances must not be descendants of each other.")
end
end
for _, descendant in bodypartInstance:GetDescendants() do
if not descendant:IsA("Motor6D") or (functionForGettingInstancesToIgnore ~= nil and table.find(functionForGettingInstancesToIgnore(bodypartInstance), descendant) ~= nil) then
continue
end
local part0: BasePart, part1: BasePart = descendant.Part0, descendant.Part1
if part0 == nil and part1 == nil then
error("Both Part0 and Part1 of Motor6D are nil.")
end
-- I use isAncestorOf instead of isDescenantOf so that I don't need to check whether the possible
-- descendant (part0 or part1) is nil.
if bodypartInstance ~= part0 and not bodypartInstance:IsAncestorOf(part0) and bodypartInstance ~= part1 and not bodypartInstance:IsAncestorOf(part1) then
error(string.format("Neither part0 nor part1 is this bodypartInstance or a descendant of this bodypartInstance. bodypartInstance: %s; part0: %s; part1: %s", tostring(bodypartInstance), tostring(part0), tostring(part1)))
end
if (bodypartInstance == part0 or bodypartInstance:IsAncestorOf(part0)) and (bodypartInstance == part1 or bodypartInstance:IsAncestorOf(part1)) then
error("Both part0 and part1 are either this bodypartInstance or descendants of this bodypartInstance.")
end
local partNotInThisBodypart = if bodypartInstance == part0 or bodypartInstance:IsAncestorOf(part0) then part1 else part0
if partNotInThisBodypart ~= nil then
local isAnotherBodypartInstanceAncestorOfOrEqualToPartNotInThisBodypart = false
for _, otherBodypartInstance in bodypartInstances do
-- no need to skip iteration when otherBodypartInstance == bodypartInstance
-- because both the condition otherBodypartInstance == partNotInThisBodypart and the condition
-- otherBodypartInstance:IsAncestorOf(partNotInThisBodypart) will be false in that case.
if otherBodypartInstance == partNotInThisBodypart or otherBodypartInstance:IsAncestorOf(partNotInThisBodypart) then
isAnotherBodypartInstanceAncestorOfOrEqualToPartNotInThisBodypart = true
break
end
end
if not isAnotherBodypartInstanceAncestorOfOrEqualToPartNotInThisBodypart then
error("Found Part0 or Part1 that is not a descendant of any bodypart instance.")
end
end
end
end
end
POV let’s make a function to throw an error instead of correcting the error. It doesn’t matter if it actually matters! Throw an error anyway!
-- R6 and R15 only?
if ragdollCharacterSettings.rigType ~= RagdollRigType.Custom then
-- This code creates RigidConstraints for accessories because reparenting bodyparts sometimes destroys AccessoryWelds for some reason.
-- Also, WeldConstraints don't work because their enabled property gets set to false for some reason. That's why I used
-- RigidConstraints instead.
for _, descendant in ragdollStructure.InstanceHierarchyTopInstance:getDescendants() do
if descendant.ClassName == "Accessory" then
local handle = descendant:FindFirstChild("Handle")
if handle == nil then
error("Accessory is missing Handle.")
end
--[[
local accessoryWeld = handle:FindFirstChild("AccessoryWeld")
if accessoryWeld == nil then
error("Accessory Handle is missing AccessoryWeld. Accessory instance name: " .. descendant.Name)
end
--]]
local handleJoints = handle:getJoints()
local weld, bodypartBasePart
for _, joint in handleJoints do
if joint.ClassName == "Weld" then
weld = joint
bodypartBasePart = if weld.Part0 == handle then weld.Part1 else weld.Part0
end
end
if weld == nil then
error(`Weld missing. Accessory: {descendant:GetFullName()}`)
end
if not AccessoryUtility.isLayeredClothingInstance(descendant) then
--print(descendant.Name .. "is not a layered clothing instance.")
--accessoryWeld.Enabled = false
end