R_uskovski
(R_uskovski)
September 10, 2020, 7:45pm
#1
Hey, any idea why this doesn’t work?
https://gyazo.com/58b2e3d8cbaf2746d9fdd279f49d36ff
---function for radgoll---
--<<<<<<<<<<<<<>>>>>>>>>>>>>-
local function radgoll(player)
local character = player.Character
for i,v in pairs(character:GetChildren()) 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
end
end
character.HumanoidRootPart.CanCollide = false
end
game.Players.PlayerAdded:Connect(function(plr)
plr.CharacterAdded:Connect(function(char)
local humanoid = char:WaitForChild("Humanoid")
wait(5)
radgoll(plr)
end)
end)
8_zn
(kyle)
September 10, 2020, 7:54pm
#2
You have to check when the player dies, so you would have to utilize the Humanoid.Died
event like this:
game.Players.PlayerAdded:Connect(function(plr)
plr.CharacterAdded:Connect(function(char)
local humanoid = char:WaitForChild("Humanoid")
humanoid.Died:Connect(function()
ragdoll(plr)
end)
end)
end)
1 Like
R_uskovski
(R_uskovski)
September 10, 2020, 7:55pm
#3
I’m trying to radgoll them even if they don’t die, aka radgoll them alive and un-radgoll them alive.
R_uskovski
(R_uskovski)
September 10, 2020, 7:58pm
#4
minimic2002
(minimic2002)
September 10, 2020, 8:02pm
#5
Its because the motor6Ds are still connected. So the default roblox joints are holding it all in place.
1 Like
R_uskovski
(R_uskovski)
September 10, 2020, 8:03pm
#6
And how can I fix that in my script?
minimic2002
(minimic2002)
September 10, 2020, 8:06pm
#7
Simply disabled them. Then enable them when you no longer want to ragdoll.
1 Like
minimic2002
(minimic2002)
September 10, 2020, 8:18pm
#9
In theory it should be working then. So long as roblox doesnt treat them like a joint and continue as normal.
But clearly something going on. I’ve tried disabling and connecting it to attachments and it seems to work.
1 Like
R_uskovski
(R_uskovski)
September 10, 2020, 8:19pm
#10
R_uskovski:
---function for radgoll---
--<<<<<<<<<<<<<>>>>>>>>>>>>>-
local function radgoll(player)
local character = player.Character
for i,v in pairs(character:GetChildren()) 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
end
end
character.HumanoidRootPart.CanCollide = false
end
game.Players.PlayerAdded:Connect(function(plr)
plr.CharacterAdded:Connect(function(char)
local humanoid = char:WaitForChild("Humanoid")
wait(5)
radgoll(plr)
end)
end)
I found the problem, I used GetChildren instead of GetDescendants.