Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Grab = Instance.new("Tool", owner.Backpack)
- Grab.Name = "Grab"
- local P = Instance.new("Part", Grab)
- P.Name = "Handle"
- P.Size = Vector3.new(1,1,1)
- P.Transparency = 1
- P.CanCollide = false
- local S = Instance.new("Part", Grab)
- S.Name = "S"
- S.Size = Vector3.new(5.5,5,5.5)
- S.Transparency = 0.5
- S.CanCollide = false
- S.Shape = Enum.PartType.Cylinder
- S.TopSurface = Enum.SurfaceType.Smooth
- S.BottomSurface = Enum.SurfaceType.Smooth
- local W1 = Instance.new("Weld", Grab)
- W1.Name = "W1"
- W1.Part0 = P
- W1.Part1 = S
- W1.C0 = CFrame.fromOrientation(0,0,80.1) + Vector3.new(0,0,-5)
- local P2 = Instance.new("Part", Grab)
- P2.Name = "Handle"
- P2.Size = Vector3.new(1,1,1)
- P2.Transparency = 1
- P2.CanCollide = false
- local W2 = Instance.new("Weld", Grab)
- W2.Name = "W2"
- W2.Part0 = S
- W2.Part1 = P2
- W2.C0 = CFrame.fromOrientation(0,0,-80.1) + Vector3.new(0,0,-1)
- local plr = Instance.new("ObjectValue", Grab)
- plr.Name = "plr"
- db = false
- S.Touched:Connect(function(c)
- if db then
- if c.Parent:FindFirstChild("HumanoidRootPart") then
- plr.Value = c.Parent
- elseif c.Parent:FindFirstChild("Torso") then
- plr.Value = c.Parent
- elseif c.Parent:FindFirstChild("UpperTorso") then
- plr.Value = c.Parent
- end
- end
- end)
- Grab.Activated:Connect(function()
- if plr.Value == nil then
- db = true
- else
- plr.Value = nil
- end
- end)
- Grab.Deactivated:Connect(function()
- db = false
- end)
- while true do
- if plr.Value == nil then
- local a = 1
- else
- if plr.Value:FindFirstChild("HumanoidRootPart") then
- plr.Value:FindFirstChild("HumanoidRootPart").CFrame = P2.CFrame
- elseif plr.Value:FindFirstChild("Torso") then
- plr.Value:FindFirstChild("Torso").CFrame = P2.CFrame
- elseif plr.Value:FindFirstChild("UpperTorso") then
- plr.Value:FindFirstChild("UpperTorso").CFrame = P2.CFrame
- end
- end
- wait(0.001)
- end
Add Comment
Please, Sign In to add comment