Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Activate = function(Humanoid)
- local Folder = Instance.new("Folder")
- local Weld = Instance.new("WeldConstraint")
- Humanoid.BreakJointsOnDeath = false
- Humanoid.RequiresNeck = false
- Humanoid.PlatformStand = true
- Humanoid.Parent.HumanoidRootPart.CanCollide = false
- Humanoid.Parent.HumanoidRootPart.Massless = true
- Folder.Name = "Rig_Parts"
- Folder.Parent = Humanoid
- Weld.Name = "Root_Anchor"
- Weld.Part0 = Humanoid.Parent.HumanoidRootPart
- Weld.Part1 = Humanoid.Parent.LowerTorso
- Weld.Parent = Humanoid
- for i,State in pairs(Enum.HumanoidStateType:GetEnumItems()) do
- if State ~= Enum.HumanoidStateType.PlatformStanding and State ~= Enum.HumanoidStateType.Dead and State ~= Enum.HumanoidStateType.None then
- Humanoid:SetStateEnabled(State,false)
- end
- end
- for i,Object in pairs(Humanoid.Parent:GetChildren()) do
- if Object:IsA("BasePart") and Object:FindFirstChildOfClass("Motor6D") then
- local Joint = Object:FindFirstChildOfClass("Motor6D")
- local NoCollision = Instance.new("NoCollisionConstraint")
- local BallSocket = Instance.new("BallSocketConstraint")
- NoCollision.Name = Object.Name.."_Constraint"
- NoCollision.Part0 = Joint.Part0
- NoCollision.Part1 = Joint.Part1
- NoCollision.Parent = Humanoid
- BallSocket.Name = Object.Name.."_Weld"
- BallSocket.Parent = Humanoid
- end
- end
- for i,Object in pairs(Humanoid.Parent:GetChildren()) do
- if Object:IsA("BasePart") and Object:FindFirstChildOfClass("Motor6D") then
- local Joint = Object:FindFirstChildOfClass("Motor6D")
- local BallSocket = Humanoid[Object.Name.."_Weld"]
- if Joint.Part0:FindFirstChild(Joint.Name.."RigAttachment") then
- BallSocket.Attachment0 = Joint.Part0[Joint.Name.."RigAttachment"]
- end
- BallSocket.Attachment1 = Joint.Part1[Joint.Name.."RigAttachment"]
- BallSocket.Radius = 0.5
- BallSocket.LimitsEnabled = true
- BallSocket.TwistLimitsEnabled = true
- BallSocket.Restitution = 0.5
- Joint.Enabled = false
- if not Object.CanCollide then
- Object.Parent = Folder
- Object.CanCollide = true
- end
- end
- end
- Humanoid.PlatformStand = true
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement