Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- READ THE SETTINGS BELOW --
- local KeepWhenDie = false -- Keep the gui when you die and respawn.
- local LockFirstPerson = false -- Locks the victim(s)'s camera to first person while captured.
- local LeaveCollar = true -- Leaves the collar on the people you capture after releasing them.
- local RealisticMode = true
- -- ^ With this enabled, you have to put the collar on the person (click them). Then they will show in the list.
- -- ^ Click them again while not leashed to take it off.
- --[[
- //Made by Roblotic_Roblox
- [Updates]
- // Teleport players is fixed.
- // Updated gui.
- // New mode.
- // Fixed list loading.
- // Added a thing that keeps you from losing the gui when you die.
- --]]
- -- Don't touch anything below for the best experience. -- (plus im a sloppy c0der xd) --
- local Captured = false
- local Players = {}
- local Leashed = {}
- function leash(plr)
- if Captured then
- Release(plr)
- end
- local Char = game.Players[plr].Character
- Master = game.Players.LocalPlayer.Character
- local Neck = Instance.new("Part")
- local Pole = Instance.new("Part")
- Pole.Name = plr.."Pole"
- Pole.Size = Vector3.new(0.1,0.1,0.1)
- Pole.Transparency = 1
- local Weld4 = Instance.new("Weld")
- Weld4.Parent = Pole
- Weld4.Part0 = Pole
- Weld4.Part1 = Master["Left Arm"]
- Weld4.C0 = CFrame.new(0,0.9,0)
- Pole.Parent = Master["Left Arm"]
- local Attachment = Instance.new("Attachment", Neck)
- Attachment.Name = plr.."Attachment"
- local Attachment1 = Instance.new("Attachment", Pole)
- Attachment1.Name = plr.."Attachment1"
- Neck.Size = Vector3.new(0.1,0.1,0.1)
- Neck.CanCollide = false
- Neck.Transparency = 1
- Neck.Name = plr.."Neck"
- local Weld3 = Instance.new("Weld")
- Weld3.Parent = Neck
- Weld3.Part0 = Neck
- Weld3.Part1 = Char.Head
- Weld3.C0 = CFrame.new(0,0.5,0.55)
- Weld3.Name = plr.."Weld3"
- Neck.Parent = Char.Head
- local BodyGyro1 = Instance.new("BodyGyro", Char.Torso)
- BodyGyro1.Name = plr.."BodyGyro1"
- local BodyGyro2 = Instance.new("BodyGyro", Master.Torso)
- BodyGyro2.Name = plr.."BodyGyro2"
- if not RealisticMode then
- local Collar = Instance.new("Part")
- Collar.Size = Vector3.new(1,0.2,1)
- Collar.CanCollide = false
- Collar.Transparency = 0
- Collar.Name = plr.."Collar"
- Collar.BrickColor = BrickColor.Black()
- local CollarMesh = Instance.new("CylinderMesh", Collar)
- CollarMesh.Scale = Vector3.new(1.2,0.8,1.2)
- local Weld6 = Instance.new("Weld")
- Weld6.Parent = Collar
- Weld6.Part0 = Collar
- Weld6.Part1 = Char.Head
- Weld6.C0 = CFrame.new(0,0.5,0)
- Collar.Parent = Char.Head
- end
- local Leash = Instance.new("RopeConstraint", Master["Left Arm"])
- Leash.Color = BrickColor.Black()
- Leash.Thickness = 0.1
- Leash.Visible = true
- Leash.Name = plr.."Leash"
- Leash.Restitution = 1
- Leash.Length = 5
- Leash.Attachment0 = Attachment
- Leash.Attachment1 = Attachment1
- Char.Humanoid.WalkSpeed = 0
- Char.Humanoid.PlatformStand = true
- Char.Humanoid.Sit = true
- local Clone = Char.HumanoidRootPart:Clone()
- Clone.Name = plr.."HumanoidRootPart"
- Clone.Parent = game.Players.LocalPlayer.PlayerScripts
- Char.HumanoidRootPart:Destroy()
- Char.Humanoid.Died:connect(function()
- Release(plr)
- end)
- Master.Humanoid.Died:connect(function()
- Release(plr)
- end)
- table.insert(Leashed, plr)
- end
- local selecteduser = nil
- local NewGuiPart1 = Instance.new("ScreenGui", game.Players.LocalPlayer.PlayerGui)
- local NewGuiPart2 = Instance.new("TextLabel")
- NewGuiPart2.Size = UDim2.new(0, 300, 0, 20)
- NewGuiPart2.Position = UDim2.new(0.5, -150, 0.4, -10)
- NewGuiPart2.Font = Enum.Font.Bodoni
- NewGuiPart2.FontSize = Enum.FontSize.Size14
- NewGuiPart2.Text = "Leash Gui"
- NewGuiPart2.TextScaled = true
- NewGuiPart2.TextWrapped = true
- NewGuiPart2.Draggable = true
- NewGuiPart2.Active = true
- NewGuiPart2.Parent = NewGuiPart1
- NewGuiPart2.BackgroundTransparency = 0.6
- NewGuiPart2.BorderSizePixel = 0
- NewGuiPart2.TextColor3 = Color3.new(1,1,1)
- local NewGuiPart3 = Instance.new("Frame")
- NewGuiPart3.Name = "Main"
- NewGuiPart3.Position = UDim2.new(0, 0, 1, 0)
- NewGuiPart3.Size = UDim2.new(1, 0, 0, 150)
- NewGuiPart3.Parent = NewGuiPart2
- NewGuiPart3.BackgroundTransparency = 0.6
- NewGuiPart3.BorderSizePixel = 0
- local NewGuiPart4 = Instance.new("TextButton")
- NewGuiPart4.Active = true
- NewGuiPart4.Name = "LeashEm"
- NewGuiPart4.Position = UDim2.new(0, 0, 1, -30)
- NewGuiPart4.Selectable = true
- NewGuiPart4.Size = UDim2.new(1, 0, 0, 30)
- NewGuiPart4.Style = Enum.ButtonStyle.Custom
- NewGuiPart4.Font = Enum.Font.Antique
- NewGuiPart4.FontSize = Enum.FontSize.Size14
- NewGuiPart4.Text = "Leash Em"
- NewGuiPart4.TextScaled = true
- NewGuiPart4.TextWrapped = true
- NewGuiPart4.Parent = NewGuiPart3
- NewGuiPart4.BackgroundTransparency = 0.6
- NewGuiPart4.BorderSizePixel = 0
- NewGuiPart4.TextColor3 = Color3.new(1,1,1)
- local NewGuiPart5 = Instance.new("ScrollingFrame")
- NewGuiPart5.Name = "Players"
- NewGuiPart5.Selectable = true
- NewGuiPart5.Size = UDim2.new(1, 0, 0, 100)
- NewGuiPart5.ClipsDescendants = true
- NewGuiPart5.Parent = NewGuiPart3
- NewGuiPart5.BackgroundTransparency = 0.6
- NewGuiPart5.BorderSizePixel = 0
- local ListUI = Instance.new("UIListLayout", NewGuiPart5)
- local Selected = Instance.new("TextLabel", NewGuiPart4)
- Selected.Position = UDim2.new(0,0,0,-20)
- Selected.Size = UDim2.new(1,0,0,20)
- Selected.Text = "Selected: nil"
- Selected.BackgroundTransparency = 0.6
- Selected.BorderSizePixel = 0
- Selected.TextColor3 = Color3.new(1,1,1)
- NewGuiPart4.MouseButton1Down:connect(function()
- local found = false
- for i,v in pairs(Leashed) do
- if selecteduser == v then
- found = true
- end
- end
- if found then
- Release(selecteduser)
- else
- if selecteduser ~= nil then
- if game.Players:FindFirstChild(selecteduser) then
- wait()
- Capture(selecteduser)
- end
- end
- end
- end)
- function Capture(user)
- local char = user
- if LockFirstPerson then
- if game.Players:FindFirstChild(char) then
- game.Players[char].CameraMode = "LockFirstPerson"
- end
- end
- TP(char)
- NewGuiPart4.Text = "Release"
- NewGuiPart5[char].BackgroundColor3 = Color3.new(0.5,1,0.5)
- wait()
- leash(char)
- end
- function TP(plr)
- game.Players[plr].Character.HumanoidRootPart.CFrame = game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame * CFrame.new(0,1,-4) * CFrame.Angles(0,math.rad(180),0)
- end
- function Release(plr)
- local found = false
- local pos = 0
- for i,v in pairs(Leashed) do
- if v == plr then
- found = true
- pos = i
- end
- end
- if found then
- local player = game.Players[plr].Character
- player.Head[plr.."Neck"]:Destroy()
- Master["Left Arm"][plr.."Pole"]:Destroy()
- game.Players[plr].Character.Torso[plr.."BodyGyro1"]:Destroy()
- Master.Torso[plr.."BodyGyro2"]:Destroy()
- Master["Left Arm"][plr.."Leash"]:Destroy()
- local rootpart = game.Players.LocalPlayer.PlayerScripts[plr.."HumanoidRootPart"]
- rootpart.Name = "HumanoidRootPart"
- rootpart.Parent = player
- player.Humanoid.WalkSpeed = 16
- player.Humanoid.PlatformStand = false
- player.Humanoid.Sit = false
- if not LeaveCollar or not RealisticMode then
- player.Head[plr.."Collar"]:Destroy()
- end
- game.Players[plr].CameraMode = "Classic"
- NewGuiPart4.Text = "Leash Em"
- NewGuiPart5.Visible = true
- NewGuiPart5[plr].BackgroundColor3 = Color3.new(1,0.5,0.5)
- table.remove(Leashed, pos)
- wait()
- TP(selecteduser)
- end
- end
- function playerbuttons(name)
- local button = Instance.new("TextButton", NewGuiPart5)
- button.Size = UDim2.new(1, 0, 0, 25)
- button.BackgroundColor3 = Color3.new(1,0.5,0.5)
- button.TextColor3 = Color3.new(0.9,0.9,0.9)
- button.BorderSizePixel = 0
- button.BackgroundTransparency = 0.7
- button.TextScaled = true
- button.Text = name
- button.Name = name
- button.MouseButton1Down:connect(function()
- Selected.Text = "Selected: "..name
- selecteduser = name
- checkleashed(name)
- end)
- NewGuiPart5.CanvasSize = UDim2.new(0,0,0, NewGuiPart5.CanvasSize.Y.Offset + 25)
- end
- function checkleashed(plr)
- if NewGuiPart5:FindFirstChild(plr) then
- local found = false
- for i,v in pairs(Leashed) do
- if v == plr then
- found = true
- end
- end
- if found then
- NewGuiPart4.Text = "Release"
- else
- NewGuiPart4.Text = "Leash em"
- end
- end
- end
- if not RealisticMode then
- game.Players.ChildAdded:connect(function(thing)
- UpdateList()
- end)
- end
- game.Players.ChildRemoved:connect(function(thing)
- UpdateList()
- end)
- local LocalPlayer = game.Players.LocalPlayer
- local Mouse = LocalPlayer:GetMouse()
- if RealisticMode then
- Mouse.Button1Down:connect(function()
- local found = false
- local hit = Mouse.Target
- local AlreadyIn = false
- for i,v in pairs(Leashed)do
- if hit.Parent.Name == v then
- found = true
- end
- end
- if not found then
- if hit ~= nil then
- if hit.Parent:FindFirstChildOfClass("Humanoid") then
- if hit.Parent.Head:FindFirstChild("Collar") then
- AlreadyIn = true
- end
- if not AlreadyIn then
- local Collar = Instance.new("Part")
- Collar.Size = Vector3.new(1,0.2,1)
- Collar.CanCollide = false
- Collar.Name = "Collar"
- Collar.Transparency = 0
- Collar.BrickColor = BrickColor.Black()
- local CollarMesh = Instance.new("CylinderMesh", Collar)
- CollarMesh.Scale = Vector3.new(1.2,0.8,1.2)
- local Weld6 = Instance.new("Weld")
- Weld6.Parent = Collar
- Weld6.Part0 = Collar
- Weld6.Part1 = hit.Parent:FindFirstChild("Head")
- Weld6.C0 = CFrame.new(0,0.5,0)
- Collar.Parent = hit.Parent:FindFirstChild("Head")
- print('Complete!')
- table.insert(Players, hit.Parent.Name)
- UpdateList()
- else
- local Collar = hit.Parent.Head:FindFirstChild("Collar")
- Collar:Destroy()
- for i,v in pairs(Players) do
- if v == hit.Parent.Name then
- table.remove(Players, i)
- end
- end
- UpdateList()
- end
- end
- end
- end
- end)
- end
- function UpdateList()
- NewGuiPart5.CanvasSize = UDim2.new(0,0,0,0)
- for i,v in pairs(NewGuiPart5:GetChildren()) do
- if v.ClassName == "TextButton" then
- v:Destroy()
- end
- end
- for i,v in pairs(Leashed) do
- if not game.Players:FindFirstChild(v) then
- Master["Left Arm"][v.."Pole"]:Destroy()
- Master.Torso[v.."BodyGyro2"]:Destroy()
- Master["Left Arm"][v.."Leash"]:Destroy()
- game.Players.LocalPlayer.PlayerScripts[v.."HumanoidRootPart"]:Destroy()
- table.remove(Leashed, i)
- end
- if NewGuiPart5:FindFirstChild(v) then
- NewGuiPart5[v].BackgroundColor3 = Color3.new(0.5,1,0.5)
- end
- end
- if RealisticMode then
- for i,v in pairs(Players) do
- if game.Players:FindFirstChild(v) then
- playerbuttons(v)
- end
- end
- else
- for i,v in pairs(game.Players:GetChildren()) do
- if v.Name ~= game.Players.LocalPlayer.Name then
- playerbuttons(v.Name)
- end
- end
- end
- for i,v in pairs(Leashed)do
- if NewGuiPart5:FindFirstChild(v) then
- NewGuiPart5[v].BackgroundColor3 = Color3.new(0.5,1,0.5)
- end
- end
- end
- function diething()
- game.Players.LocalPlayer.Character.Humanoid.Died:connect(function()
- wait(4.9)
- NewGuiPart1.Parent = game.Players.LocalPlayer.PlayerScripts
- game.Players.LocalPlayer.CharacterAdded:connect(function(character)
- NewGuiPart1.Parent = game.Players.LocalPlayer.PlayerGui
- diething()
- wait(0.1)
- end)
- end)
- end
- UpdateList()
- if KeepWhenDie then
- wait(1)
- diething()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement