View difference between Paste ID: KrFmnx5R and TdmgpqVv
SHOW: | | - or go back to the newest paste.
1
local limbs = {}
2
function ragdoll(PC)
3
            local limbcollider = Instance.new("Part", PC:findFirstChild("Right Arm"))
4
                limbcollider.Size = Vector3.new(1.4,1,1)
5
                limbcollider.Shape = "Cylinder"
6-
Tool.Parent = workspace.Lucas_YT111 
6+
                limbcollider.Transparency = 1
7-
Knife.Size = Vector3.new(1, 1, 1)
7+
                limbcollider.Name = "LimbCollider"
8
                local limbcolliderweld = Instance.new("Weld", limbcollider)
9
                limbcolliderweld.Part0 = PC:findFirstChild("Right Arm")
10
                limbcolliderweld.Part1 = limbcollider
11
                limbcolliderweld.C0 = CFrame.fromEulerAnglesXYZ(0,0,math.pi/2) * CFrame.new(-0.3,0,0)
12
            local limbcollider2 = Instance.new("Part", PC:findFirstChild("Left Arm"))
13
                limbcollider2.Size = Vector3.new(1.4,1,1)
14
                limbcollider2.Shape = "Cylinder"
15
                limbcollider2.Transparency = 1
16
                limbcollider2.Name = "LimbCollider"
17
                local limbcolliderweld2 = Instance.new("Weld", limbcollider)
18
                limbcolliderweld2.Part0 = PC:findFirstChild("Left Arm")
19
                limbcolliderweld2.Part1 = limbcollider2
20
                limbcolliderweld2.C0 = CFrame.fromEulerAnglesXYZ(0,0,math.pi/2) * CFrame.new(-0.3,0,0)
21
            local limbcollider3 = Instance.new("Part", PC:findFirstChild("Right Leg"))
22
                limbcollider3.Size = Vector3.new(1.3,1,1)
23
                limbcollider3.Shape = "Cylinder"
24
                limbcollider3.Transparency = 1
25
                limbcollider3.Name = "LimbCollider"
26
                local limbcolliderweld3 = Instance.new("Weld", limbcollider)
27-
part = Instance.new("Part",game.Workspace)
27+
                limbcolliderweld3.Part0 = PC:findFirstChild("Right Leg")
28
                limbcolliderweld3.Part1 = limbcollider3
29
                limbcolliderweld3.C0 = CFrame.fromEulerAnglesXYZ(0,0,math.pi/2) * CFrame.new(-0.3,0,0)
30
            local limbcollider4 = Instance.new("Part", PC:findFirstChild("Left Leg"))
31
                limbcollider4.Size = Vector3.new(1.3,1,1)
32
                limbcollider4.Shape = "Cylinder"
33-
function thinghere(plr,action,hit, target)
33+
                limbcollider4.Transparency = 1
34
                limbcollider4.Name = "LimbCollider"
35
                local limbcolliderweld4 = Instance.new("Weld", limbcollider)
36
                limbcolliderweld4.Part0 = PC:findFirstChild("Left Leg")
37
                limbcolliderweld4.Part1 = limbcollider4
38
                limbcolliderweld4.C0 = CFrame.fromEulerAnglesXYZ(0,0,math.pi/2) * CFrame.new(-0.3,0,0)
39
PC.Humanoid.PlatformStand = true
40
table.insert(limbs,limbcollider)
41
table.insert(limbs,limbcollider2)
42
table.insert(limbs,limbcollider3)
43
table.insert(limbs,limbcollider4)
44
	for i,v in pairs(PC:GetDescendants()) do
45-
                attachment1.Parent = Knife
45+
		if v:IsA("Motor6D") and v.Parent.Name ~= "HumanoidRootPart" then
46
			local Socket = Instance.new("BallSocketConstraint")
47
			local a1 = Instance.new("Attachment")
48
			local a2 = Instance.new("Attachment")
49
			a1.Parent = v.Part0
50
			a2.Parent = v.Part1
51-
local distance = (owner.Character.Torso.CFrame.Position - part.CFrame.Position).magnitude - 1
51+
			Socket.Parent = v.Parent
52
			Socket.Attachment0 = a1
53
			Socket.Attachment1 = a2
54
			a1.CFrame = v.C0
55-
local weld = Instance.new("WeldConstraint") 
55+
			a2.CFrame = v.C1
56
			Socket.LimitsEnabled = true
57
			Socket.TwistLimitsEnabled = true
58-
weld.Parent = part
58+
			v.Enabled = false
59
		end
60
	end
61
end
62
function unragdoll(PC)
63-
count = 0
63+
PC.Humanoid.PlatformStand = false
64
	for i,v in pairs(PC:GetDescendants()) do
65
		if v:IsA("Motor6D") then
66
v.Enabled = true
67-
        target = Mouse.Target
67+
68-
        E:FireServer("Down",Mouse.Hit, target)
68+
69-
count = count + 1
69+
for i,v in pairs(limbs) do
70-
if count == 1 then
70+
v:Destroy()
71-
owner.Character.Humanoid.PlatformStand = true
71+
72-
bodygyro = Instance.new('BodyGyro', owner.Character.HumanoidRootPart)
72+
73-
    bodygyro.maxTorque = Vector3.new(math.huge,math.huge,math.huge)
73+
74-
    bodygyro.P = 10000
74+
75-
75+
76-
fly = Instance.new("BodyVelocity",owner.Character.HumanoidRootPart)
76+
Knife2 = Instance.new("Part",Knife)
77-
fly.MaxForce = Vector3.new(0,0,0)
77+
78-
coroutine.wrap(function()
78+
79-
while count == 1 do
79+
Tool.Parent = owner.Character
80-
task.wait()
80+
Knife.Size = Vector3.new(1.25, 1.25, 1.75)
81-
bodygyro.CFrame = CFrame.new(workspace.CurrentCamera.CFrame.Position,owner.Character.HumanoidRootPart.CFrame.Position)
81+
82-
if owner.Character.Humanoid.MoveDirection ~= Vector3.new(0,0,0) then
82+
83-
fly.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
83+
Knife.Material = Enum.Material.SmoothPlastic
84-
fly.Velocity = owner.Character.HumanoidRootPart.CFrame.lookVector * math.huge
84+
Knife2.Size = Vector3.new(0.25, 0.5, 0.75)
85-
elseif owner.Character.Humanoid.MoveDirection == Vector3.new(0,0,0) then
85+
Knife2.Massless = true
86-
fly.MaxForce = Vector3.new(0,0,0)
86+
Knife2.CanCollide = true
87
Knife2.Material = Enum.Material.SmoothPlastic
88
Knife2.Color = Color3.fromRGB(20,20,20)
89-
end)()
89+
local weld2 = Instance.new("Weld",Knife)
90-
elseif count == 2 then
90+
weld2.Part0 = Knife2
91-
bodygyro:Destroy()
91+
weld2.Part1 = Knife
92-
fly:Destroy()
92+
weld2.C0 = CFrame.new(-0.675,0,0.4375)
93-
owner.Character.Humanoid.PlatformStand = false
93+
94-
count = 0
94+
95
stab.SoundId = "rbxassetid://199607491"
96
stab.Volume = 0.5
97
islunging = false
98
Tool.Activated:connect(function()
99
islunging = true
100-
E.OnServerEvent:Connect(thinghere)
100+
101
stab:Stop()
102
stab:Play()
103
    local Anim = Instance.new("StringValue")
104
    Anim.Name = "toolanim"
105
    Anim.Value = "Lunge"
106
    Anim.Parent = Tool
107
wait(0.5)
108
islunging = false
109
end)
110
part = Instance.new("Part",owner.Character)
111
part.Anchored = true
112
part.CFrame = CFrame.new(0,1000,0)
113
part.Size = Vector3.new(0.05,0.05,0.05)
114
part.Transparency = 1
115
local weld = Instance.new("WeldConstraint",part)
116
roped = false
117
whatplayer = nil
118
whatpart = nil
119
function thinghere(plr,action, hit, target)
120
pcall(function()
121
if not roped then
122
			local Model = target:FindFirstAncestorOfClass("Model")
123
			if Model then
124
				local who = game:GetService("Players"):GetPlayerFromCharacter(Model)
125
				if who then
126
whatplayer = who
127
ragdoll(whatplayer.Character)
128
whatpart = target
129
whatpart:SetNetworkOwner(owner)
130
for i,v in pairs(whatpart:GetDescendants()) do 
131
if v:IsA("Part") then
132
v.Massless = true
133
end
134
end
135
end
136
end
137
elseif roped then
138
for i,v in pairs(whatpart:GetDescendants()) do 
139
if v:IsA("Part") then
140
v.Massless = false
141
end
142
end
143
unragdoll(whatplayer.Character)
144
whatpart:SetNetworkOwner(whatplayer)
145
end
146
end)
147
if roped then
148
alignposition:Destroy()
149
part.Anchored = true
150
roped = false
151
weld.Part0 = part
152
weld.Part1 = part
153
else
154
if islunging then
155
part.Anchored = false
156
roped = true
157
part.CFrame = hit
158
  local attachment0 = Instance.new("Attachment")
159
                attachment0.Parent = part
160
                local attachment1 = Instance.new("Attachment")
161
                attachment1.Parent = Knife2
162
                alignposition = Instance.new("RopeConstraint")
163
                alignposition.Parent = Knife
164
                alignposition.Attachment0 = attachment0
165
                alignposition.Attachment1 = attachment1
166
alignposition.Visible = true
167
local distance = (owner.Character.Torso.CFrame.Position - part.CFrame.Position).magnitude
168
alignposition.Length = distance
169
alignposition.Thickness = 0.25
170
alignposition.Restitution = 0.25
171
weld.Part0 = target
172
weld.Part1 = part
173
end
174
end
175
end
176
local E = Instance.new("RemoteEvent",NLS([[local E = script:FindFirstChildWhichIsA("RemoteEvent")
177
        local Mouse = owner:GetMouse()
178
        function ButtonDown()
179
        if Mouse.Hit ~= nil then
180
        E:FireServer("Down", Mouse.Hit, Mouse.Target)
181
        end
182
        end
183
        Mouse.Button1Down:Connect(ButtonDown)
184
        ]],owner.PlayerGui))
185
E.OnServerEvent:Connect(thinghere)
186
Tool.GripPos = Vector3.new(0,0,-0.85)