I have a ragdoll bomb for my script… its basically the roblox time bomb but instead of killing people it ragdolls them. I’ve got the ragdoll part done but the issue is when the player gets up or un-ragdolls… Its very funny to watch grimace shake around and jitter all crazy but I don’t want them to reset their avatars because they went flying…
When the function fires it’s like the player gets all jittery and starts flying everywhere… Here a to explain what I mean.
robloxapp-20230827-0913058.wmv (1.7 MB)
Here is the specific un-ragdoll code. and later on, it gets used inside the blowup function.
local function resetPose(character)
local humanoid = character:FindFirstChildOfClass("Humanoid")
if humanoid then
humanoid.PlatformStand = false
humanoid:Move(Vector3.new(0, 0, 0)) -- Reset the position modification
for _, part in pairs(character:GetDescendants()) do
if part:IsA("BasePart") and part:FindFirstChildOfClass("WeldConstraint") then
part.Anchored = false
part:FindFirstChildOfClass("WeldConstraint"):Remove()
end
end
end
end
I’ve tried 1 solution but it still resulted in the same jittery movement…
It is basically the same code but with minor changes. But I’m stuck cause I have 0 idea why its jittering…
local function resetPose(character)
local humanoid = character:FindFirstChildOfClass("Humanoid")
if humanoid then
humanoid.PlatformStand = false
humanoid:Move(Vector3.new(0, 0, 0)) -- Reset the position modification
for _, part in pairs(character:GetDescendants()) do
if part:IsA("BasePart") then
part.Anchored = false
end
end
end
end
Here is the whole script if you want
Summary
local updateInterval = .4
local currentColor = 1
local colors = {26, 21}
local ticksound = Instance.new("Sound")
ticksound.SoundId = "rbxasset://sounds\\clickfast.wav"
ticksound.Parent = script.Parent
function update()
updateInterval = updateInterval * .9
script.Parent.BrickColor = BrickColor.new(colors[currentColor])
currentColor = currentColor + 1
if (currentColor > 2) then currentColor = 1 end
end
local function applyRagdoll(player)
-- Create a Humanoid and a HumanoidRig
local character = player.Character
local humanoid = character:FindFirstChildOfClass("Humanoid")
local humanoidRig = character:FindFirstChild("HumanoidRootPart")
if humanoid and humanoidRig then
humanoid.PlatformStand = true -- Prevent the character from standing up
humanoid:Move(Vector3.new(0, 1, 0)) -- Move the character slightly to prevent collisions
for index,joint in pairs(character: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
end
end
local function resetPose(character)
local humanoid = character:FindFirstChildOfClass("Humanoid")
if humanoid then
humanoid.PlatformStand = false
humanoid:Move(Vector3.new(0, 0, 0)) -- Reset the position modification
for _, part in pairs(character:GetDescendants()) do
if part:IsA("BasePart") and part:FindFirstChildOfClass("WeldConstraint") then
part.Anchored = false
part:FindFirstChildOfClass("WeldConstraint"):Remove()
end
end
end
end
function blowUp()
local sound = Instance.new("Sound")
sound.SoundId = "rbxasset://sounds\\Rocket shot.wav"
sound.Parent = script.Parent
sound.Volume = 1
sound:play()
local explosion = Instance.new("Explosion")
explosion.BlastRadius = 10
explosion.BlastPressure = 1
explosion.DestroyJointRadiusPercent = 0
-- find instigator tag
local creator = script.Parent:findFirstChild("creator")
if creator ~= nil then
-- put the ragdoll script in here
end
explosion.Position = script.Parent.Position
explosion.Parent = game.Workspace
script.Parent.Transparency = 1
local explosionPosition = script.Parent.Position
local players = game.Players:GetPlayers()
for _, player in pairs(players) do
local character = player.Character
local humanoidRootPart = character and character:FindFirstChild("HumanoidRootPart")
print(player.Name)
if humanoidRootPart then
local distance = (explosionPosition - humanoidRootPart.Position).Magnitude
if distance <= explosion.BlastRadius then
applyRagdoll(player)
wait(2) -- Ragdoll for 2 seconds
resetPose(character)
end
end
end
end
while updateInterval > .1 do
wait(updateInterval)
update()
ticksound:play()
end
blowUp()
wait(2)
script.Parent:remove()
Any help is greatly appreciated and I thank you for your help
-Brant