lafur

Untitled

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