You can write your topic however you want, but you need to answer these questions:
- What do you want to achieve? Keep it simple and clear!
I am currently making a game where players are hit with a weapon. When hit, players are flung and ragdoll. The game is set to r15
- What is the issue? Include screenshots / videos if possible!
The issue here is that at times, the player will randomly die and or vanish when they hit the floor and re-appear and I believe the issue is the ragdoll script.
Thereās another issue where the character being ragdolled flops arounds on the ground. Iād like it to be a smooth ragdoll like in Slap Battles and then the player unragdolls. I am not sure if the issue is with R15 rigs.
I am not a good scripter, so please dont hate on me lol.
- What solutions have you tried so far? Did you look for solutions on the Developer Hub?
Iāve tried looking into module scripts posted on devforum; however, Iāve had no luck due to being new to developing.
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that itās easier for people to help you!
The ragdoll script is located within the weapon and is activated through a function within the hithandler (flings the player on hit)
Here is the ragdoll script below:
local humanoid = script.Parent.Parent:WaitForChild(āHumanoidā)
humanoid.BreakJointsOnDeath = false
humanoid.RequiresNeck = false
wait(0.01)
for index,joint in pairs(script.Parent.Parent:GetDescendants()) do
if joint:IsA(āMotor6Dā) then
local socket = Instance.new(āBallSocketConstraintā)
local a1 = Instance.new(āAttachmentā)
local a2 = Instance.new(āAttachmentā)
a1.Parent = joint.Part0
a2.Parent = joint.Part1
socket.Parent = joint.Parent
socket.Attachment0 = a1
socket.Attachment1 = a2
a1.CFrame = joint.c0
a2.CFrame = joint.c1
socket.LimitsEnabled = true
socket.TwistLimitsEnabled = true
joint:Destroy()
end
end
wait(1.5)
for i, v in pairs(script.Parent.Parent:GetDescendants()) do
if v:IsA(āBallSocketConstraintā) then
v.UpperAngle = 0
v.TwistUpperAngle = 0
v.TwistLowerAngle = 0
local Joins = Instance.new("Motor6D", v.Parent)
Joins.Part0 = v.Attachment0.Parent
Joins.Part1 = v.Attachment1.Parent
Joins.C0 = v.Attachment0.CFrame
Joins.C1 = v.Attachment1.CFrame
v:Destroy()
end
end
script.Parent:Destroy()