Advertisement
SlappyDappyCrappy

collar

Jul 27th, 2017
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 11.10 KB | None | 0 0
  1. -- https://pastebin.com/raw/a3LD7ayv --
  2. -- READ THE SETTINGS BELOW --
  3.  
  4. local KeepWhenDie = true-- Keep the gui when you die and respawn.
  5. local LockFirstPerson = false -- Locks the victim(s)'s camera to first person while captured.
  6. local LeaveCollar = false -- Leaves the collar on the people you capture after releasing them.
  7. local RealisticMode = false
  8.  
  9. -- ^ With this enabled, you have to put the collar on the person (click them). Then they will show in the list.
  10. -- ^ Click them again while not leashed to take it off.
  11.  
  12.  
  13. --[[
  14.     //  Created by Peyton. Discord = [] Peyton []#5640
  15.     //  Send me suggestions. Maybe I'll add your idea to it.   
  16.  
  17.     //  Teleport players is fixed.
  18.     //  Updated gui.
  19.     //  New mode.
  20.     //  Fixed list loading.
  21.     //  Added a thing that keeps you from losing the gui when you die.
  22. --]]
  23.  
  24.  
  25. -- Don't touch anything below for the best experience. -- (plus im a sloppy c0der xd) --
  26.  
  27. local Captured = false
  28.  
  29. local Players = {}
  30.  
  31. local Leashed = {}
  32.  
  33. function leash(plr)
  34. if Captured then
  35.     Release(plr)
  36. end
  37. local Char = game.Players[plr].Character
  38. Master = game.Players.LocalPlayer.Character
  39.  
  40.  
  41. local Neck = Instance.new("Part")
  42.  
  43. local Pole = Instance.new("Part")
  44. Pole.Name = plr.."Pole"
  45. Pole.Size = Vector3.new(0.1,0.1,0.1)
  46. Pole.Transparency = 1
  47.  
  48. local Weld4 = Instance.new("Weld")
  49. Weld4.Parent = Pole
  50. Weld4.Part0 = Pole
  51. Weld4.Part1 = Master["Left Arm"]
  52. Weld4.C0 = CFrame.new(0,0.9,0)
  53.  
  54. Pole.Parent = Master["Left Arm"]
  55.  
  56. local Attachment = Instance.new("Attachment", Neck)
  57. Attachment.Name = plr.."Attachment"
  58. local Attachment1 = Instance.new("Attachment", Pole)
  59. Attachment1.Name = plr.."Attachment1"
  60.  
  61. Neck.Size = Vector3.new(0.1,0.1,0.1)
  62. Neck.CanCollide = false
  63. Neck.Transparency = 1
  64. Neck.Name = plr.."Neck"
  65.  
  66. local Weld3 = Instance.new("Weld")
  67. Weld3.Parent = Neck
  68. Weld3.Part0 = Neck
  69. Weld3.Part1 = Char.Head
  70. Weld3.C0 = CFrame.new(0,0.5,0.55)
  71. Weld3.Name = plr.."Weld3"
  72. Neck.Parent = Char.Head
  73.  
  74. local BodyGyro1 = Instance.new("BodyGyro", Char.Torso)
  75. BodyGyro1.Name = plr.."BodyGyro1"
  76. local BodyGyro2 = Instance.new("BodyGyro", Master.Torso)
  77. BodyGyro2.Name = plr.."BodyGyro2"
  78.  
  79.  
  80. if not RealisticMode then
  81. local Collar = Instance.new("Part")
  82. Collar.Size = Vector3.new(1,0.2,1)
  83. Collar.CanCollide = false
  84. Collar.Transparency = 0
  85. Collar.Name = plr.."Collar"
  86. Collar.BrickColor = BrickColor.Black()
  87.  
  88. local CollarMesh = Instance.new("CylinderMesh", Collar)
  89. CollarMesh.Scale = Vector3.new(1.2,0.8,1.2)
  90.  
  91. local Weld6 = Instance.new("Weld")
  92. Weld6.Parent = Collar
  93. Weld6.Part0 = Collar
  94. Weld6.Part1 = Char.Head
  95. Weld6.C0 = CFrame.new(0,0.5,0)
  96.  
  97. Collar.Parent = Char.Head
  98. end
  99.  
  100. local Leash = Instance.new("RopeConstraint", Master["Left Arm"])
  101. Leash.Color = BrickColor.Black()
  102. Leash.Thickness = 0.1
  103. Leash.Visible = true
  104. Leash.Name = plr.."Leash"
  105. Leash.Restitution = 1
  106. Leash.Length = 5
  107.  
  108. Leash.Attachment0 = Attachment
  109. Leash.Attachment1 = Attachment1
  110.  
  111. Char.Humanoid.WalkSpeed = 0
  112. Char.Humanoid.PlatformStand = true
  113. Char.Humanoid.Sit = true
  114. local Clone = Char.HumanoidRootPart:Clone()
  115. Clone.Name = plr.."HumanoidRootPart"
  116. Clone.Parent = game.Players.LocalPlayer.PlayerScripts
  117. Char.HumanoidRootPart:Destroy()
  118.  
  119. Char.Humanoid.Died:connect(function()
  120.     Release(plr)
  121. end)
  122.  
  123. Master.Humanoid.Died:connect(function()
  124.     Release(plr)
  125. end)
  126. table.insert(Leashed, plr)
  127. end
  128.  
  129. local selecteduser = nil
  130.  
  131. local NewGuiPart1 = Instance.new("ScreenGui", game.Players.LocalPlayer.PlayerGui)
  132.  
  133. local NewGuiPart2 = Instance.new("TextLabel")
  134. NewGuiPart2.Size = UDim2.new(0, 300, 0, 20)
  135. NewGuiPart2.Position = UDim2.new(0.5, -150, 0.4, -10)
  136. NewGuiPart2.Font = Enum.Font.Bodoni
  137. NewGuiPart2.FontSize = Enum.FontSize.Size14
  138. NewGuiPart2.Text = "Leash Gui"
  139. NewGuiPart2.TextScaled = true
  140. NewGuiPart2.TextWrapped = true
  141. NewGuiPart2.Draggable = true
  142. NewGuiPart2.Active = true
  143. NewGuiPart2.Parent = NewGuiPart1
  144. NewGuiPart2.BackgroundTransparency = 0.6
  145. NewGuiPart2.BorderSizePixel = 0
  146. NewGuiPart2.TextColor3 = Color3.new(1,1,1)
  147.  
  148. local NewGuiPart3 = Instance.new("Frame")
  149. NewGuiPart3.Name = "Main"
  150. NewGuiPart3.Position = UDim2.new(0, 0, 1, 0)
  151. NewGuiPart3.Size = UDim2.new(1, 0, 0, 150)
  152. NewGuiPart3.Parent = NewGuiPart2
  153. NewGuiPart3.BackgroundTransparency = 0.6
  154. NewGuiPart3.BorderSizePixel = 0
  155.  
  156. local NewGuiPart4 = Instance.new("TextButton")
  157. NewGuiPart4.Active = true
  158. NewGuiPart4.Name = "LeashEm"
  159. NewGuiPart4.Position = UDim2.new(0, 0, 1, -30)
  160. NewGuiPart4.Selectable = true
  161. NewGuiPart4.Size = UDim2.new(1, 0, 0, 30)
  162. NewGuiPart4.Style = Enum.ButtonStyle.Custom
  163. NewGuiPart4.Font = Enum.Font.Antique
  164. NewGuiPart4.FontSize = Enum.FontSize.Size14
  165. NewGuiPart4.Text = "Leash Em"
  166. NewGuiPart4.TextScaled = true
  167. NewGuiPart4.TextWrapped = true
  168. NewGuiPart4.Parent = NewGuiPart3
  169. NewGuiPart4.BackgroundTransparency = 0.6
  170. NewGuiPart4.BorderSizePixel = 0
  171. NewGuiPart4.TextColor3 = Color3.new(1,1,1)
  172.  
  173. local NewGuiPart5 = Instance.new("ScrollingFrame")
  174. NewGuiPart5.Name = "Players"
  175. NewGuiPart5.Selectable = true
  176. NewGuiPart5.Size = UDim2.new(1, 0, 0, 100)
  177. NewGuiPart5.ClipsDescendants = true
  178. NewGuiPart5.Parent = NewGuiPart3
  179. NewGuiPart5.BackgroundTransparency = 0.6
  180. NewGuiPart5.BorderSizePixel = 0
  181.  
  182. local ListUI = Instance.new("UIListLayout", NewGuiPart5)
  183.  
  184. local Selected = Instance.new("TextLabel", NewGuiPart4)
  185. Selected.Position = UDim2.new(0,0,0,-20)
  186. Selected.Size = UDim2.new(1,0,0,20)
  187. Selected.Text = "Selected: nil"
  188. Selected.BackgroundTransparency = 0.6
  189. Selected.BorderSizePixel = 0
  190. Selected.TextColor3 = Color3.new(1,1,1)
  191.  
  192. NewGuiPart4.MouseButton1Down:connect(function()
  193.     local found = false
  194.     for i,v in pairs(Leashed) do
  195.         if selecteduser == v then
  196.             found = true
  197.         end
  198.     end
  199.     if found then
  200.         Release(selecteduser)
  201.     else
  202.         if selecteduser ~= nil then
  203.             if game.Players:FindFirstChild(selecteduser) then
  204.                 wait()
  205.                 Capture(selecteduser)
  206.             end
  207.         end
  208.     end
  209. end)
  210.  
  211. function Capture(user)
  212.     local char = user
  213.     if LockFirstPerson then
  214.         if game.Players:FindFirstChild(char) then
  215.             game.Players[char].CameraMode = "LockFirstPerson"
  216.         end
  217.     end
  218.     TP(char)
  219.     NewGuiPart4.Text = "Release"
  220.     NewGuiPart5[char].BackgroundColor3 = Color3.new(0.5,1,0.5)
  221.     wait()
  222.     leash(char)
  223. end
  224.  
  225. function TP(plr)
  226.     game.Players[plr].Character.HumanoidRootPart.CFrame = game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame * CFrame.new(0,1,-4) * CFrame.Angles(0,math.rad(180),0)
  227. end
  228.  
  229. function Release(plr)
  230. local found = false
  231. local pos = 0
  232. for i,v in pairs(Leashed) do
  233.     if v == plr then
  234.         found = true
  235.         pos = i
  236.     end
  237. end
  238. if found then
  239. local player = game.Players[plr].Character
  240.     player.Head[plr.."Neck"]:Destroy()
  241.     Master["Left Arm"][plr.."Pole"]:Destroy()
  242.     game.Players[plr].Character.Torso[plr.."BodyGyro1"]:Destroy()
  243.     Master.Torso[plr.."BodyGyro2"]:Destroy()
  244.     Master["Left Arm"][plr.."Leash"]:Destroy()
  245.     local rootpart = game.Players.LocalPlayer.PlayerScripts[plr.."HumanoidRootPart"]
  246.     rootpart.Name = "HumanoidRootPart"
  247.     rootpart.Parent = player
  248.     player.Humanoid.WalkSpeed = 16
  249.     player.Humanoid.PlatformStand = false
  250.     player.Humanoid.Sit = false
  251.     if not LeaveCollar or not RealisticMode then   
  252.     player.Head[plr.."Collar"]:Destroy()
  253.     end
  254.     game.Players[plr].CameraMode = "Classic"
  255.     NewGuiPart4.Text = "Leash Em"
  256.     NewGuiPart5.Visible = true
  257.     NewGuiPart5[plr].BackgroundColor3 = Color3.new(1,0.5,0.5)
  258.     table.remove(Leashed, pos)
  259.     wait()
  260.     TP(selecteduser)
  261. end
  262. end
  263.  
  264. function playerbuttons(name)
  265.     local button = Instance.new("TextButton", NewGuiPart5)
  266.     button.Size = UDim2.new(1, 0, 0, 25)
  267.     button.BackgroundColor3 = Color3.new(1,0.5,0.5)
  268.     button.TextColor3 = Color3.new(0.9,0.9,0.9)
  269.     button.BorderSizePixel = 0
  270.     button.BackgroundTransparency = 0.7
  271.     button.TextScaled = true
  272.     button.Text = name
  273.     button.Name = name
  274.     button.MouseButton1Down:connect(function()
  275.         Selected.Text = "Selected: "..name
  276.         selecteduser = name
  277.         checkleashed(name)
  278.     end)
  279.     NewGuiPart5.CanvasSize = UDim2.new(0,0,0, NewGuiPart5.CanvasSize.Y.Offset + 25)
  280. end
  281.  
  282. function checkleashed(plr)
  283.     if NewGuiPart5:FindFirstChild(plr) then
  284.         local found = false
  285.         for i,v in pairs(Leashed) do
  286.             if v == plr then
  287.                 found = true
  288.             end
  289.         end
  290.         if found then
  291.             NewGuiPart4.Text = "Release"
  292.         else
  293.             NewGuiPart4.Text = "Leash em"
  294.         end
  295.     end
  296. end
  297.  
  298. if not RealisticMode then
  299. game.Players.ChildAdded:connect(function(thing)
  300.     UpdateList()
  301. end)
  302. end
  303.  
  304. game.Players.ChildRemoved:connect(function(thing)
  305.     UpdateList()
  306. end)
  307.  
  308.  
  309. local LocalPlayer = game.Players.LocalPlayer
  310. local Mouse = LocalPlayer:GetMouse()
  311.  
  312. if RealisticMode then
  313. Mouse.Button1Down:connect(function()
  314. local found = false
  315. local hit = Mouse.Target
  316. local AlreadyIn = false
  317.  
  318. for i,v in pairs(Leashed)do
  319.     if hit.Parent.Name == v then
  320.         found = true
  321.     end
  322. end
  323. if not found then
  324. if hit ~= nil then
  325.     if hit.Parent:FindFirstChildOfClass("Humanoid") then
  326.         if hit.Parent.Head:FindFirstChild("Collar") then
  327.             AlreadyIn = true
  328.         end
  329.         if not AlreadyIn then
  330.             local Collar = Instance.new("Part")
  331.             Collar.Size = Vector3.new(1,0.2,1)
  332.             Collar.CanCollide = false
  333.             Collar.Name = "Collar"
  334.             Collar.Transparency = 0
  335.             Collar.BrickColor = BrickColor.Black()
  336.  
  337.             local CollarMesh = Instance.new("CylinderMesh", Collar)
  338.             CollarMesh.Scale = Vector3.new(1.2,0.8,1.2)
  339.  
  340.             local Weld6 = Instance.new("Weld")
  341.             Weld6.Parent = Collar
  342.             Weld6.Part0 = Collar
  343.             Weld6.Part1 = hit.Parent:FindFirstChild("Head")
  344.             Weld6.C0 = CFrame.new(0,0.5,0)
  345.  
  346.             Collar.Parent = hit.Parent:FindFirstChild("Head")
  347.             print('Complete!')
  348.             table.insert(Players, hit.Parent.Name)
  349.             UpdateList()
  350.         else
  351.             local Collar = hit.Parent.Head:FindFirstChild("Collar")
  352.             Collar:Destroy()
  353.             for i,v in pairs(Players) do
  354.                 if v == hit.Parent.Name then
  355.                     table.remove(Players, i)
  356.                 end
  357.             end
  358.             UpdateList()
  359.         end
  360.     end
  361. end
  362. end
  363. end)
  364. end
  365.  
  366. function UpdateList()
  367.     NewGuiPart5.CanvasSize = UDim2.new(0,0,0,0)
  368.     for i,v in pairs(NewGuiPart5:GetChildren()) do
  369.         if v.ClassName == "TextButton" then
  370.             v:Destroy()
  371.         end
  372.     end
  373.     for i,v in pairs(Leashed) do
  374.         if not game.Players:FindFirstChild(v) then
  375.             Master["Left Arm"][v.."Pole"]:Destroy()
  376.             Master.Torso[v.."BodyGyro2"]:Destroy()
  377.             Master["Left Arm"][v.."Leash"]:Destroy()
  378.             game.Players.LocalPlayer.PlayerScripts[v.."HumanoidRootPart"]:Destroy()
  379.             table.remove(Leashed, i)
  380.         end
  381.         if NewGuiPart5:FindFirstChild(v) then
  382.             NewGuiPart5[v].BackgroundColor3 = Color3.new(0.5,1,0.5)
  383.         end
  384.     end
  385.     if RealisticMode then
  386.         for i,v in pairs(Players) do
  387.             if game.Players:FindFirstChild(v) then
  388.                 playerbuttons(v)
  389.             end
  390.         end
  391.     else   
  392.         for i,v in pairs(game.Players:GetChildren()) do
  393.             if v.Name ~= game.Players.LocalPlayer.Name then
  394.                 playerbuttons(v.Name)
  395.             end
  396.         end
  397.     end
  398.     for i,v in pairs(Leashed)do
  399.         if NewGuiPart5:FindFirstChild(v) then
  400.             NewGuiPart5[v].BackgroundColor3 = Color3.new(0.5,1,0.5)
  401.         end
  402.     end
  403.    
  404.    
  405. end
  406.  
  407. function diething()
  408.     game.Players.LocalPlayer.Character.Humanoid.Died:connect(function()
  409.         wait(4.9)
  410.         NewGuiPart1.Parent = game.Players.LocalPlayer.PlayerScripts
  411.         game.Players.LocalPlayer.CharacterAdded:connect(function(character)
  412.             NewGuiPart1.Parent = game.Players.LocalPlayer.PlayerGui
  413.             diething()
  414.             wait(0.1)
  415.         end)
  416.     end)
  417. end
  418.  
  419. UpdateList()
  420. if KeepWhenDie then
  421. wait(1)
  422. diething()
  423. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement