Advertisement
dimjunel

Untitled

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