Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --controls
- --R = point right arm towards mouse
- --L = point left arm towards mouse
- --IT MAY BUG BECAUSE SOMETIMES THE LIMBS THE GLUE/BallSocketConstraint MAY DESTROY THE LIMB AFTER SOME TIME.
- -- I MIGHT OF FIXED IT THOUGH
- -- I CHANGED Glue TO BallSocketConstraint
- -- it could not be fixed though.
- ragdoll = game.Players.LocalPlayer.Character
- c = ragdoll
- player = ragdoll
- local RealTorso = player.Torso
- local RealHead = player.Head
- local RealLeftleg = player["Left Leg"]
- local RealRightleg = player["Right Leg"]
- local RealLeftArm = player["Left Arm"]
- local RealRightArm = player["Right Arm"]
- ragdoll.Humanoid.BreakJointsOnDeath = false
- -- head --
- ok = Instance.new("Attachment",ragdoll.Torso)
- ok.Position = Vector3.new(0,1,0)
- ok2 = Instance.new("Attachment",ragdoll.Head)
- ok2.Position = Vector3.new(0,-0.5,0)
- local headglue = Instance.new("BallSocketConstraint", RealTorso)
- headglue.Attachment0 = ok
- headglue.Attachment1 = ok2
- -- left arm --
- ok3 = Instance.new("Attachment",RealTorso)
- ok3.Position = Vector3.new(-1.5, 0.5, 0)
- ok4 = Instance.new("Attachment",RealLeftArm)
- ok4.Position = Vector3.new(0, 0.5, 0)
- coroutine.resume(coroutine.create(function()
- while wait() do
- if not RealTorso:FindFirstChild("rightlegglue") then
- local leftarmglue = Instance.new("BallSocketConstraint", RealTorso)
- leftarmglue.Attachment0 = ok3
- leftarmglue.Attachment1 = ok4
- leftarmglue.Name = "rightlegglue"
- end
- end
- end))
- -- right arm --
- ok5 = Instance.new("Attachment",RealTorso)
- ok5.Position = Vector3.new(1.5, 0.5, 0)
- ok6 = Instance.new("Attachment",RealRightArm)
- ok6.Position = Vector3.new(0, 0.5, 0)
- coroutine.resume(coroutine.create(function()
- while wait() do
- if not RealTorso:FindFirstChild("rightarmglue") then
- local leftarmglue = Instance.new("BallSocketConstraint", RealTorso)
- leftarmglue.Attachment0 = ok5
- leftarmglue.Attachment1 = ok6
- leftarmglue.Name = "rightarmglue"
- end
- end
- end))
- -- left leg --
- ok7 = Instance.new("Attachment",RealTorso)
- ok7.Position = Vector3.new(-0.5, -1, 0)
- ok8 = Instance.new("Attachment",RealLeftleg)
- ok8.Position = Vector3.new(0, 1, 0)
- coroutine.resume(coroutine.create(function()
- while wait() do
- if not RealTorso:FindFirstChild("leglegglue") then
- local leftarmglue = Instance.new("BallSocketConstraint", RealTorso)
- leftarmglue.Attachment0 = ok7
- leftarmglue.Attachment1 = ok8
- leftarmglue.Name = "leftlegglue"
- end
- end
- end))
- -- right leg --
- ok9 = Instance.new("Attachment",RealTorso)
- ok9.Position = Vector3.new(0.5, -1, 0)
- ok10 = Instance.new("Attachment",RealRightleg)
- ok10.Position = Vector3.new(0, 1, 0)
- coroutine.resume(coroutine.create(function()
- while wait() do
- if not RealTorso:FindFirstChild("rightlegglue") then
- local leftarmglue = Instance.new("BallSocketConstraint", RealTorso)
- leftarmglue.Attachment0 = ok9
- leftarmglue.Attachment1 = ok10
- end
- end
- end))
- RealTorso["Left Hip"]:Destroy()
- RealTorso["Right Hip"]:Destroy()
- RealTorso["Left Shoulder"]:Destroy()
- RealTorso["Right Shoulder"]:Destroy()
- RealTorso.Neck.Part0 = nil
- mouse = game.Players.LocalPlayer:GetMouse()
- camera = game.Workspace.CurrentCamera
- char = ragdoll
- local camPart2 = Instance.new("Part", camera)
- camPart2.Size = Vector3.new(0, 0, 0)
- camPart2.CFrame = camera.CFrame
- camPart2.CanCollide = false
- camPart2.Anchored = true
- camPart2.Transparency = 1
- local camPart = Instance.new("Part", camera)
- camPart.Size = Vector3.new(0, 0, 0)
- camPart.CFrame = CFrame.new(char.Head.Position, camPart2.Position) * CFrame.Angles(0,math.rad(180),0)
- camPart.CanCollide = false
- camPart.Anchored = true
- camPart.Transparency = 1
- local camPart3 = Instance.new("Part", camera)
- camPart3.Size = Vector3.new(0, 0, 0)
- camPart3.Position = mouse.hit.p
- camPart3.CanCollide = false
- camPart3.Anchored = true
- camPart3.Transparency = 1
- bodygyroxd = Instance.new("BodyGyro",char.Head)
- bodygyroxd.MaxTorque = Vector3.new(math.huge,math.huge,math.huge)
- armvector = Instance.new("BodyGyro",RealRightArm)
- armvector.MaxTorque = Vector3.new(math.huge,math.huge,math.huge)
- armvector2 = Instance.new("BodyGyro",RealLeftArm)
- armvector2.MaxTorque = Vector3.new(math.huge,math.huge,math.huge)
- local pos = nil
- local pos2 = nil
- rpointer = false
- lpointer = false
- mouse.KeyDown:Connect(function(key)
- if key == "r" then
- rpointer = true
- end
- end)
- mouse.KeyUp:Connect(function(key)
- if key == "r" then
- rpointer = false
- end
- end)
- mouse.KeyUp:Connect(function(key)
- if key == "l" then
- lpointer = false
- end
- end)
- mouse.KeyDown:Connect(function(key)
- if key == "l" then
- lpointer = true
- end
- end)
- game:GetService("RunService").RenderStepped:Connect(function()
- camPart3.Position = mouse.hit.p
- camPart2.CFrame = camera.CFrame
- camPart.CFrame = CFrame.new(char.Head.Position, camPart2.Position) * CFrame.Angles(0,math.rad(180),0)
- pos = camPart.Position
- pos2 = camPart3.Position
- bodygyroxd.CFrame = camPart.CFrame
- if rpointer == true then
- armvector.MaxTorque = Vector3.new(math.huge,math.huge,math.huge)
- else
- armvector.MaxTorque = Vector3.new(0,0,0)
- end
- if lpointer == true then
- armvector2.MaxTorque = Vector3.new(math.huge,math.huge,math.huge)
- else
- armvector2.MaxTorque = Vector3.new(0,0,0)
- end
- armvector.CFrame = CFrame.new(armvector.Parent.Position,camPart3.Position) * CFrame.Angles(math.rad(90),0,0)
- armvector2.CFrame = CFrame.new(armvector.Parent.Position,camPart3.Position) * CFrame.Angles(math.rad(90),0,0)
- end)
- char["Right Arm"].LocalTransparencyModifier = 0
- char["Left Arm"].LocalTransparencyModifier = 0
- while game:GetService('RunService').RenderStepped:wait() do
- char['Left Arm'].LocalTransparencyModifier = 0
- char['Right Arm'].LocalTransparencyModifier = 0
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement