Explination:
Once the player hits the rock it ragdolls but then the character flys up into the sky cause of the problem have no i dea? || Video clip below & the code is below the video
Dont mind the music in the background was listening to something…
Code
newShard.Touched:Connect(function(touch)
if touch.Parent:FindFirstChild("Humanoid") and touch.Parent ~= plr.Character and not charactersHit[touch.Parent] then
charactersHit[touch.Parent] = true
for _, v in pairs(touch.Parent:GetDescendants()) do
if v:IsA("Motor6D") then
local a0, a1 = Instance.new("Attachment"), Instance.new("Attachment")
a0.CFrame = v.C0
a1.CFrame = v.C1
a0.Parent = v.Part0
a1.Parent = v.Part1
local b = Instance.new("BallSocketConstraint")
b.Attachment0 = a0
b.Attachment1 = a1
b.Parent = v.Part0
v.Enabled = false
touch.Parent.Humanoid:ChangeState(Enum.HumanoidStateType.Ragdoll)
touch.Parent.HumanoidRootPart.CanCollide = false
touch.Parent.Humanoid.BreakJointsOnDeath = true
touch.Parent.Humanoid.RequiresNeck = false
end
end
wait(3)
touch.Parent.Humanoid:ChangeState(Enum.HumanoidStateType.GettingUp)
touch.Parent.HumanoidRootPart.CanCollide = false
touch.Parent.Humanoid.BreakJointsOnDeath = true
touch.Parent.Humanoid.RequiresNeck = false
for _,v in pairs(touch.Parent:GetDescendants()) do
if v:IsA('Motor6D') then
v.Enabled = true
end
if v.Name == 'BallSocketConstraint' then
v:Destroy()
end
if v.Name == 'Attachment' then
v:Destroy()
end
end
end
end)