Advertisement
exploit43262

Untitled

Jul 23rd, 2022
30
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 36.77 KB | None | 0 0
  1. if Loaded then return end
  2. getgenv().Loaded = true;
  3.  
  4. -- Libraries:
  5. local workspace = workspace;
  6.  
  7. local Janitor; do -- Janitor
  8. local IndicesReference = newproxy(true)
  9. getmetatable(IndicesReference).__tostring = function()
  10. return "IndicesReference"
  11. end
  12.  
  13. local LinkToInstanceIndex = newproxy(true)
  14. getmetatable(LinkToInstanceIndex).__tostring = function()
  15. return "LinkToInstanceIndex"
  16. end
  17.  
  18. local METHOD_NOT_FOUND_ERROR = "Object %s doesn't have method %s, are you sure you want to add it? Traceback: %s"
  19.  
  20. local janitor = {
  21. ClassName = "Janitor";
  22. __index = {
  23. CurrentlyCleaning = true;
  24. [IndicesReference] = nil;
  25. };
  26. }
  27.  
  28. local TypeDefaults = {
  29. ["function"] = true;
  30. RBXScriptConnection = "Disconnect";
  31. }
  32.  
  33. function janitor.new()
  34. return setmetatable({
  35. CurrentlyCleaning = false;
  36. [IndicesReference] = nil;
  37. }, janitor)
  38. end
  39.  
  40. function janitor.Is(Object)
  41. return type(Object) == "table" and getmetatable(Object) == janitor
  42. end
  43.  
  44. function janitor.__index:Add(Object, MethodName, Index)
  45. if Index then
  46. self:Remove(Index)
  47.  
  48. local This = self[IndicesReference]
  49. if not This then
  50. This = {}
  51. self[IndicesReference] = This
  52. end
  53.  
  54. This[Index] = Object
  55. end
  56.  
  57. MethodName = MethodName or TypeDefaults[typeof(Object)] or "Destroy"
  58. if type(Object) ~= "function" and not Object[MethodName] then
  59. warn(string.format(METHOD_NOT_FOUND_ERROR, tostring(Object), tostring(MethodName), debug.traceback(nil, 2)))
  60. end
  61.  
  62. self[Object] = MethodName
  63. return Object
  64. end
  65.  
  66. function janitor.__index:Remove(Index)
  67. local This = self[IndicesReference]
  68.  
  69. if This then
  70. local Object = This[Index]
  71.  
  72. if Object then
  73. local MethodName = self[Object]
  74.  
  75. if MethodName then
  76. if MethodName == true then
  77. Object()
  78. else
  79. local ObjectMethod = Object[MethodName]
  80. if ObjectMethod then
  81. ObjectMethod(Object)
  82. end
  83. end
  84.  
  85. self[Object] = nil
  86. end
  87.  
  88. This[Index] = nil
  89. end
  90. end
  91.  
  92. return self
  93. end
  94.  
  95. function janitor.__index:Get(Index)
  96. local This = self[IndicesReference]
  97. if This then
  98. return This[Index]
  99. else
  100. return nil
  101. end
  102. end
  103.  
  104. function janitor.__index:Cleanup()
  105. if not self.CurrentlyCleaning then
  106. self.CurrentlyCleaning = nil
  107. for Object, MethodName in next, self do
  108. if Object == IndicesReference then
  109. continue
  110. end
  111.  
  112. if MethodName == true then
  113. Object()
  114. else
  115. local ObjectMethod = Object[MethodName]
  116. if ObjectMethod then
  117. ObjectMethod(Object)
  118. end
  119. end
  120.  
  121. self[Object] = nil
  122. end
  123.  
  124. local This = self[IndicesReference]
  125. if This then
  126. for Index in next, This do
  127. This[Index] = nil
  128. end
  129.  
  130. self[IndicesReference] = {}
  131. end
  132.  
  133. self.CurrentlyCleaning = false
  134. end
  135. end
  136.  
  137. function janitor.__index:Destroy()
  138. self:Cleanup()
  139. table.clear(self)
  140. setmetatable(self, nil)
  141. end
  142.  
  143. janitor.__call = janitor.__index.Cleanup
  144.  
  145. local Disconnect = {Connected = true}
  146. Disconnect.__index = Disconnect
  147. function Disconnect:Disconnect()
  148. if self.Connected then
  149. self.Connected = false
  150. self.Connection:Disconnect()
  151. end
  152. end
  153.  
  154. function Disconnect:__tostring()
  155. return "Disconnect<" .. tostring(self.Connected) .. ">"
  156. end
  157.  
  158. function janitor.__index:LinkToInstance(Object, AllowMultiple)
  159. local Connection
  160. local IndexToUse = AllowMultiple and newproxy(false) or LinkToInstanceIndex
  161. local IsNilParented = Object.Parent == nil
  162. local ManualDisconnect = setmetatable({}, Disconnect)
  163.  
  164. local function ChangedFunction(_DoNotUse, NewParent)
  165. if ManualDisconnect.Connected then
  166. _DoNotUse = nil
  167. IsNilParented = NewParent == nil
  168.  
  169. if IsNilParented then
  170. task.defer(function()
  171. if not ManualDisconnect.Connected then
  172. return
  173. elseif not Connection.Connected then
  174. self:Cleanup()
  175. else
  176. while IsNilParented and Connection.Connected and ManualDisconnect.Connected do
  177. task.wait()
  178. end
  179.  
  180. if ManualDisconnect.Connected and IsNilParented then
  181. self:Cleanup()
  182. end
  183. end
  184. end)
  185. end
  186. end
  187. end
  188.  
  189. Connection = Object.AncestryChanged:Connect(ChangedFunction)
  190. ManualDisconnect.Connection = Connection
  191.  
  192. if IsNilParented then
  193. ChangedFunction(nil, Object.Parent)
  194. end
  195.  
  196. Object = nil
  197. return self:Add(ManualDisconnect, "Disconnect", IndexToUse)
  198. end
  199.  
  200. function janitor.__index:LinkToInstances(...)
  201. local ManualCleanup = Janitor.new()
  202. for _, Object in ipairs({...}) do
  203. ManualCleanup:Add(self:LinkToInstance(Object, true), "Disconnect")
  204. end
  205.  
  206. return ManualCleanup
  207. end
  208.  
  209. Janitor = janitor
  210. end
  211.  
  212. local DrawingESP; do
  213. -- Constants:
  214. local RunService = game:GetService("RunService")
  215.  
  216. local Camera = workspace.CurrentCamera
  217.  
  218. -- Cache:
  219. local RunningESPs = {}
  220. local WorldToViewportPoint = Camera.WorldToViewportPoint
  221. local IsDescendantOf = game.IsDescendantOf
  222. local NewCFrame, NewVector2, NewVector3 = CFrame.new, Vector2.new, Vector3.new
  223.  
  224. -- Functions:
  225. local function NewText(Color, Text)
  226. local Label = Drawing.new("Text")
  227. Label.Text = Text
  228. Label.Center = true
  229. Label.Visible = false
  230. Label.Position = NewVector2(0, 0)
  231. Label.Color = Color
  232. Label.Outline = true
  233. Label.Transparency = 1
  234. return Label
  235. end
  236.  
  237. local function NewLine(Color, Thickness)
  238. local Line = Drawing.new("Line")
  239. Line.Visible = false
  240. Line.From = NewVector2(0, 0)
  241. Line.To = NewVector2(0, 0)
  242. Line.Color = Color
  243. Line.Thickness = Thickness
  244. Line.Transparency = 1
  245. return Line
  246. end
  247.  
  248. local function ApplyProperties(Array, Properties)
  249. for i,v in pairs(Array) do
  250. for x,y in pairs(Properties) do
  251. v[x] = y
  252. end
  253. end
  254. end
  255.  
  256. -- Module:
  257. local Module = {}
  258. Module.RunningESPs = RunningESPs
  259. Module.__index = Module
  260.  
  261. function Module.new(Player: Player, Text: string, Color: Color3)
  262. if RunningESPs[Player] then return RunningESPs[Player] end
  263. Text = Text or ""
  264. Color = Color or Color3.fromRGB(255, 255, 255)
  265.  
  266. local _Janitor = Janitor.new();
  267. local self = setmetatable({
  268. Visible = true;
  269. Text = Text;
  270. Color3 = Color;
  271. _Player = Player;
  272. _Label = _Janitor:Add(NewText(Color, Text), "Remove"),
  273. _Library = {
  274. TL1 = _Janitor:Add(NewLine(Color, 2), "Remove"),
  275. TL2 = _Janitor:Add(NewLine(Color, 2), "Remove"),
  276.  
  277. TR1 = _Janitor:Add(NewLine(Color, 2), "Remove"),
  278. TR2 = _Janitor:Add(NewLine(Color, 2), "Remove"),
  279.  
  280. BL1 = _Janitor:Add(NewLine(Color, 2), "Remove"),
  281. BL2 = _Janitor:Add(NewLine(Color, 2), "Remove"),
  282.  
  283. BR1 = _Janitor:Add(NewLine(Color, 2), "Remove"),
  284. BR2 = _Janitor:Add(NewLine(Color, 2), "Remove")
  285. };
  286.  
  287. _Janitor = _Janitor;
  288. }, Module)
  289.  
  290. local Library = self._Library
  291. task.defer(function()
  292. local TXT = self._Label
  293. local TL1 = Library.TL1
  294. local TL2 = Library.TL2
  295.  
  296. local TR1 = Library.TR1
  297. local TR2 = Library.TR2
  298.  
  299. local BL1 = Library.BL1
  300. local BL2 = Library.BL2
  301.  
  302. local BR1 = Library.BR1
  303. local BR2 = Library.BR2
  304.  
  305. local Character = Player.Character or Player.CharacterAdded:Wait()
  306. local Humanoid = Character:WaitForChild("Humanoid", 4)
  307. local HumanoidRootPart = Character:WaitForChild("HumanoidRootPart", 4)
  308. _Janitor:Add(Player.CharacterAdded:Connect(function(character)
  309. Character = character
  310. Humanoid = character:WaitForChild("Humanoid", 4)
  311. HumanoidRootPart = character:WaitForChild("HumanoidRootPart", 4)
  312. end))
  313. _Janitor:Add(RunService.RenderStepped:Connect(function()
  314. if IsDescendantOf(Character, workspace) and Humanoid.Health > 0 then
  315. local ViewportPoint, OnScreen = WorldToViewportPoint(Camera, HumanoidRootPart.Position)
  316. if OnScreen and ViewportPoint.Z < 500 then
  317. local Position = NewCFrame(HumanoidRootPart.CFrame.Position, HumanoidRootPart.CFrame.Position + -Camera.CFrame.LookVector.Unit)
  318. local Size = NewVector3(HumanoidRootPart.Size.X, HumanoidRootPart.Size.Y * 1.5, HumanoidRootPart.Size.Z)
  319. local SizeX = Size.X
  320. local SizeY = Size.Y
  321. local TP = WorldToViewportPoint(Camera, (Position * NewCFrame(0, SizeY, 0)).Position)
  322. local TL = WorldToViewportPoint(Camera, (Position * NewCFrame(SizeX, SizeY, 0)).Position)
  323. local TR = WorldToViewportPoint(Camera, (Position * NewCFrame(-SizeX, SizeY, 0)).Position)
  324. local BL = WorldToViewportPoint(Camera, (Position * NewCFrame(SizeX, -SizeY, 0)).Position)
  325. local BR = WorldToViewportPoint(Camera, (Position * NewCFrame(-SizeX, -SizeY, 0)).Position)
  326.  
  327. local Magnitude = (Camera.CFrame.Position - HumanoidRootPart.Position).Magnitude
  328. local offset = math.clamp(750 / Magnitude, 2, 300)
  329.  
  330. TXT.Text = self.Text
  331. TXT.Position = NewVector2(TP.X, TP.Y - 30)
  332. TXT.Size = 25
  333. TXT.Visible = self.Visible
  334.  
  335. TL1.From = NewVector2(TL.X, TL.Y)
  336. TL1.To = NewVector2(TL.X + offset, TL.Y)
  337. TL2.From = NewVector2(TL.X, TL.Y)
  338. TL2.To = NewVector2(TL.X, TL.Y + offset)
  339.  
  340. TR1.From = NewVector2(TR.X, TR.Y)
  341. TR1.To = NewVector2(TR.X - offset, TR.Y)
  342. TR2.From = NewVector2(TR.X, TR.Y)
  343. TR2.To = NewVector2(TR.X, TR.Y + offset)
  344.  
  345. BL1.From = NewVector2(BL.X, BL.Y)
  346. BL1.To = NewVector2(BL.X + offset, BL.Y)
  347. BL2.From = NewVector2(BL.X, BL.Y)
  348. BL2.To = NewVector2(BL.X, BL.Y - offset)
  349.  
  350. BR1.From = NewVector2(BR.X, BR.Y)
  351. BR1.To = NewVector2(BR.X - offset, BR.Y)
  352. BR2.From = NewVector2(BR.X, BR.Y)
  353. BR2.To = NewVector2(BR.X, BR.Y - offset)
  354.  
  355. local Thickness = math.clamp(100 / Magnitude, 1, 4)
  356. ApplyProperties(Library, { Visible = self.Visible, Thickness = Thickness }) --0.1 is min thickness, 6 is max
  357. else
  358. ApplyProperties(Library, { Visible = false })
  359. TXT.Visible = false
  360. end
  361. else
  362. ApplyProperties(Library, { Visible = false })
  363. TXT.Visible = false
  364. end
  365. end))
  366. end)
  367.  
  368. _Janitor:LinkToInstance(Player)
  369. RunningESPs[Player] = self
  370. return self
  371. end
  372.  
  373. function Module:ChangeColor(Value)
  374. assert(typeof(Value) == "Color3", string.format("Invalid argument #1: Color3 expected, got %s instead!", typeof(Value)))
  375. self.Color3 = Value
  376. ApplyProperties(self._Library, {Color = Value})
  377. self._Label.Color = Value
  378. end
  379.  
  380. function Module:Destroy()
  381. RunningESPs[self._Character] = nil
  382. self._Janitor:Destroy()
  383. end
  384.  
  385. -- Export:
  386. DrawingESP = Module
  387. end
  388.  
  389. local DrawingRadar; do
  390. -- Constants:
  391. local Players = game:GetService("Players")
  392. local GuiService = game:GetService("GuiService")
  393. local RunService = game:GetService("RunService")
  394. local UserInputService = game:GetService("UserInputService")
  395.  
  396. local LocalPlayer = Players.LocalPlayer
  397. local Camera = workspace.CurrentCamera
  398.  
  399. -- Cache:
  400. local IsDescendantOf = game.IsDescendantOf
  401. local NewVector2, NewVector3, NewCFrame = Vector2.new, Vector3.new, CFrame.new
  402.  
  403. -- Functions:
  404. local function NewCircle(Transparency, Color, Radius, Filled, Thickness)
  405. local Circle = Drawing.new("Circle")
  406. Circle.Transparency = Transparency
  407. Circle.Color = Color
  408. Circle.Visible = false
  409. Circle.Thickness = Thickness
  410. Circle.Position = Vector2.new(0, 0)
  411. Circle.Radius = Radius
  412. Circle.NumSides = math.clamp(Radius * 55 / 100, 10, 75)
  413. Circle.Filled = Filled
  414. return Circle
  415. end
  416.  
  417. local function GetRelative(Position)
  418. local Character = LocalPlayer.Character
  419. if Character then
  420. local HumanoidRootPart = Character.PrimaryPart or Character:FindFirstChild("HumanoidRootPart")
  421. if HumanoidRootPart then
  422. local c = Camera.CFrame.Position
  423. local RootPosition = HumanoidRootPart.Position
  424. local CameraPosition = NewVector3(c.X, RootPosition.Y, c.Z)
  425. local NewCF = NewCFrame(RootPosition, CameraPosition)
  426. local ObjectSpace = NewCF:PointToObjectSpace(Position)
  427. return NewVector2(ObjectSpace.X, ObjectSpace.Z)
  428. end
  429. end
  430. return NewVector2(0, 0)
  431. end
  432.  
  433. -- Component:
  434. local RadarDot = {}
  435. RadarDot.__index = RadarDot
  436.  
  437. function RadarDot.new(Radar: Array, Adornee: BasePart, Color: Color3)
  438. Color = Color or Color3.fromRGB(60, 170, 255)
  439. local self = setmetatable({
  440. Color3 = Color;
  441. _Adornee = Adornee;
  442. _Dot = NewCircle(1, Color, 3, true, 1);
  443. _Janitor = Janitor.new();
  444. }, RadarDot)
  445. local PlayerDot = self._Janitor:Add(self._Dot, "Remove")
  446. self._Janitor:Add(RunService.RenderStepped:Connect(function()
  447. if IsDescendantOf(Adornee, workspace) and Radar.Visible then
  448. local Relative = GetRelative(Adornee.Position)
  449. local NewPosition = Radar.Position - Relative
  450.  
  451. local Delta = Radar.Position - NewPosition
  452. local Magnitude = Delta.Magnitude
  453. if Magnitude < (Radar.Radius - 2) then
  454. PlayerDot.Radius = 3
  455. PlayerDot.Position = NewPosition
  456. else
  457. local Offset = Delta.Unit * (Magnitude - Radar.Radius)
  458. PlayerDot.Radius = 2
  459. PlayerDot.Position = NewVector2(NewPosition.X + Offset.X, NewPosition.Y + Offset.Y)
  460. end
  461. PlayerDot.Visible = true
  462. else
  463. PlayerDot.Visible = false
  464. end
  465. end))
  466.  
  467. Radar._Janitor:Add(self._Janitor)
  468. self._Janitor:LinkToInstance(Adornee)
  469.  
  470. return self
  471. end
  472.  
  473. function RadarDot:ChangeColor(Value)
  474. assert(typeof(Value) == "Color3", string.format("Invalid argument #1: Color3 expected, got %s instead!", typeof(Value)))
  475. self.Color3 = Value
  476. self._Dot.Color = Value
  477. end
  478.  
  479. function RadarDot:Destroy()
  480. self._Janitor:Destroy()
  481. end
  482.  
  483. -- Module:
  484. local Module = {
  485. CurrentDots = {}
  486. }
  487. Module.__index = Module
  488.  
  489. function Module.new(Position: Vector2, Radius: number)
  490. local self = setmetatable({
  491. Position = Position or NewVector2(200, 200);
  492. Radius = Radius or 100;
  493. Visible = true;
  494. _Library = {};
  495. _Janitor = Janitor.new()
  496. }, Module)
  497.  
  498. -- Radar:
  499. local RadarBackground = self._Janitor:Add(NewCircle(0.9, Color3.fromRGB(10, 10, 10), self.Radius, true, 1), "Remove")
  500. local RadarBorder = self._Janitor:Add(NewCircle(0.75, Color3.fromRGB(75, 75, 75), self.Radius, false, 3), "Remove")
  501. RadarBackground.Position = self.Position
  502. RadarBorder.Position = self.Position
  503. RadarBorder.Visible = true
  504. RadarBackground.Visible = true
  505.  
  506. -- Origin:
  507. local Origin = Drawing.new("Triangle")
  508. Origin.Visible = true
  509. Origin.Thickness = 1
  510. Origin.Filled = true
  511. Origin.Color = Color3.fromRGB(255, 255, 255)
  512. Origin.PointA = self.Position + NewVector2(0, -4)
  513. Origin.PointB = self.Position + NewVector2(-3, 4)
  514. Origin.PointC = self.Position + NewVector2(3, 4)
  515.  
  516. self._Janitor:Add(RunService.RenderStepped:Connect(function()
  517. if self.Visible then
  518. RadarBackground.Visible = true
  519. RadarBorder.Visible = true
  520. Origin.Visible = true
  521. else
  522. RadarBackground.Visible = false
  523. RadarBorder.Visible = false
  524. Origin.Visible = false
  525. end
  526. end))
  527.  
  528. -- Draggable:
  529. task.spawn(function()
  530. local Inset = GuiService:GetGuiInset()
  531.  
  532. local Dragging = false
  533. local Offset = Vector2.new(0, 0)
  534. UserInputService.InputBegan:Connect(function(Input)
  535. local MousePosition = Input.Position
  536. if Input.UserInputType == Enum.UserInputType.MouseButton1 and (Vector2.new(MousePosition.X, MousePosition.Y) - self.Position).Magnitude < self.Radius then
  537. Offset = self.Position - NewVector2(Input.Position.X, Input.Position.Y)
  538. Dragging = true
  539. end
  540. end)
  541.  
  542. UserInputService.InputEnded:Connect(function(input)
  543. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  544. Dragging = false
  545. end
  546. end)
  547.  
  548. local MouseIcon = NewCircle(1, Color3.fromRGB(255, 255, 255), 3, true, 1)
  549. self._Janitor:Add(RunService.RenderStepped:Connect(function()
  550. local MouseLocation = UserInputService:GetMouseLocation()
  551. if (MouseLocation - self.Position).Magnitude < self.Radius then
  552. MouseIcon.Position = MouseLocation
  553. MouseIcon.Visible = true
  554. else
  555. MouseIcon.Visible = false
  556. end
  557. if Dragging then
  558. self.Position = Vector2.new(MouseLocation.X, MouseLocation.Y - Inset.Y) + Offset
  559. RadarBackground.Position = self.Position
  560. RadarBorder.Position = self.Position
  561. Origin.PointA = self.Position + NewVector2(0, -4)
  562. Origin.PointB = self.Position + NewVector2(-3, 4)
  563. Origin.PointC = self.Position + NewVector2(3, 4)
  564. end
  565. end))
  566. end)
  567.  
  568. return self
  569. end
  570.  
  571. function Module:CreateDot(Adornee: BasePart, Color: Color3)
  572. if Module.CurrentDots[Adornee] then return Module.CurrentDots[Adornee] end
  573. local NewDot = RadarDot.new(self, Adornee, Color)
  574. Module.CurrentDots[Adornee] = NewDot
  575. return NewDot
  576. end
  577.  
  578. function Module:FetchDot(Adornee: BasePart)
  579. return Module.CurrentDots[Adornee]
  580. end
  581.  
  582. function Module:Destroy()
  583. self._Janitor:Destroy()
  584. end
  585.  
  586. -- Export:
  587. DrawingRadar = Module
  588. end
  589.  
  590. -- Configs:
  591. local Colors = {
  592. Innocent = Color3.fromRGB(250, 250, 250);
  593. Murderer = Color3.fromRGB(255, 0, 0);
  594. Sheriff = Color3.fromRGB(0, 0, 255);
  595. Hero = Color3.fromRGB(255, 255, 0);
  596. Unknown = Color3.fromRGB(200, 200, 200);
  597. Gun = Color3.new(255, 255, 0);
  598. }
  599.  
  600. -- Services:
  601. local Players = game:GetService("Players")
  602. local ReplicatedStorage = game:GetService("ReplicatedStorage")
  603. local RunService = game:GetService("RunService")
  604.  
  605. -- Constants:
  606. local LocalPlayer = Players.LocalPlayer
  607. local Camera = workspace.CurrentCamera
  608.  
  609. -- Variables:
  610. local Murderer, Sheriff;
  611. local Roles = {}
  612.  
  613. -- Instances:
  614. local ScreenGui = Instance.new("ScreenGui", game:GetService("CoreGui"))
  615.  
  616. local RaycastParameters = RaycastParams.new()
  617. RaycastParameters.FilterType = Enum.RaycastFilterType.Blacklist
  618.  
  619. local Radar = DrawingRadar.new()
  620. Radar.Visible = false
  621.  
  622. local Box = Instance.new("BoxHandleAdornment")
  623. Box.Name = "Gun Cham"
  624. Box.Size = Vector3.new(1.1, 1.1, 1.1)
  625. Box.Color3 = Colors.Gun
  626. Box.AlwaysOnTop = true
  627. Box.ZIndex = 5
  628. Box.Transparency = 0.5
  629. Box.Parent = ScreenGui
  630.  
  631. -- Functions:
  632. local function ValidCharacter(Character: Model)
  633. if Character then
  634. local Humanoid = Character:FindFirstChildWhichIsA("Humanoid")
  635. return Character:FindFirstChild("HumanoidRootPart") and (not Character:FindFirstChildWhichIsA("ForceField")) and (Humanoid and Humanoid.Health > 0)
  636. end
  637. return false
  638. end
  639.  
  640. local function AngleDistance(a, b)
  641. return math.deg(math.acos(a:Dot(b)))
  642. end
  643.  
  644. local function UpdateRole(Player, Info)
  645. if Player then
  646. -- Role
  647. local Role = typeof(Info) == "table" and Info.Role or Info
  648. local RoleColor = Colors.Unknown
  649. if Role == "Murderer" then
  650. Murderer = Player
  651. Roles[Player] = "Murderer"
  652. RoleColor = Colors.Murderer
  653. elseif Role == "Sheriff" then
  654. Sheriff = Player
  655. Roles[Player] = "Sheriff"
  656. RoleColor = Colors.Sheriff
  657. elseif Role == "Hero" then
  658. Sheriff = Player
  659. Roles[Player] = "Hero"
  660. RoleColor = Colors.Hero
  661. elseif Role == "Innocent" then
  662. if Murderer == Player then Murderer = nil elseif Sheriff == Player then Sheriff = nil end
  663. Roles[Player] = "Innocent"
  664. RoleColor = Colors.Innocent
  665. else
  666. Roles[Player] = "Unknown"
  667. end
  668.  
  669. if Player ~= LocalPlayer then
  670. local Character = Player.Character or Player.CharacterAdded:Wait()
  671. if Character and RoleColor then
  672. DrawingESP.new(Player, Player.Name, RoleColor):ChangeColor(RoleColor)
  673. Radar:CreateDot(Character:WaitForChild("HumanoidRootPart"), RoleColor):ChangeColor(RoleColor)
  674. end
  675. end
  676. end
  677. end
  678.  
  679. local function ManualUpdate()
  680. local Data = ReplicatedStorage.GetPlayerData:InvokeServer()
  681. for i,v in ipairs(Players:GetPlayers()) do
  682. if v ~= LocalPlayer then
  683. pcall(UpdateRole, v, Data[v.Name])
  684. end
  685. end
  686. end
  687.  
  688. -- Interface:
  689. local Library = loadstring(game:HttpGet("https://lindseyhost.com/UI/LinoriaLib.lua"))();
  690. Library:SetWatermark("Linoria Community (OminousVibes)");
  691. Library:Notify("Loading UI...");
  692.  
  693. local Window = Library:CreateWindow("Murder Mystery 2");
  694.  
  695. do -- Legit
  696. local Tab = Window:AddTab("Legit");
  697.  
  698. do -- Roles
  699. local Container = Tab:AddLeftTabbox("Roles");
  700.  
  701. local Murd = Container:AddTab("Murderer");
  702. Murd:AddToggle("Reach", { Text = "Hitbox Extender", Default = false });
  703. Murd:AddSlider("Reach", { Text = "Hitbox Radius", Min = 5, Max = 20, Default = 10, Rounding = 0, Suffix = "studs" })
  704. Murd:AddSlider("ReachAngle", { Text = "Hitbox Angle", Min = 10, Max = 180, Default = 60, Rounding = 0, Suffix = "degrees" })
  705.  
  706. local Sher = Container:AddTab("Sheriff");
  707. Sher:AddToggle("SilentAim", { Text = "Silent Aim", Default = false }):AddKeyPicker("SilentAim", { Text = "Silent Aim", Default = "G", Mode = "Toggle" });
  708. Sher:AddSlider("Prediction", { Text = "Prediction", Min = 0, Max = 10, Default = 2, Rounding = 0, Suffix = "ms" });
  709. Sher:AddSlider("YOffset", { Text = "Y Offset", Min = 0, Max = 10, Default = 2, Rounding = 0, Suffix = " studs" });
  710.  
  711. local Innocent = Container:AddTab("Innocent");
  712. Innocent:AddToggle("Callouts", { Text = "Callout Murderer", Default = false }):AddKeyPicker("Callouts", { Text = "Callouts", Default = "B", Mode = "Held" });
  713. Innocent:AddInput("CalloutMessage", { Text = "Callout Message", Default = "It's ${Player}!"})
  714. end
  715.  
  716. do -- Others
  717. local Container = Tab:AddRightGroupbox("Others")
  718. Container:AddToggle("SpeedHack", { Text = "Speed Hack", Default = false }):AddKeyPicker("SpeedHack", { Text = "Speed", Default = "LeftShift", Mode = "Hold" });
  719. Container:AddSlider("Speed", { Text = "Speed", Min = 1, Max = 10, Default = 2, Rounding = 1, Suffix = "" });
  720. end
  721. end
  722.  
  723. do -- Visuals
  724. local Tab = Window:AddTab("Visuals");
  725. do -- Visuals
  726. local Container = Tab:AddLeftTabbox("Visuals");
  727.  
  728. local Player = Container:AddTab("Player");
  729. Player:AddToggle("ESP", { Text = "ESP", Default = true });
  730. Player:AddToggle("Radar", { Text = "Radar", Default = false });
  731.  
  732. local World = Container:AddTab("World");
  733. World:AddToggle("GunChams", { Text = "Gun Chams", Default = false })
  734.  
  735. local Settings = Container:AddTab("Settings");
  736. Settings:AddLabel("Innocent Color")
  737. :AddColorPicker("Innocent_Color", { Default = Colors.Innocent });
  738. Settings:AddLabel("Murderer Color")
  739. :AddColorPicker("Murderer_Color", { Default = Colors.Murderer });
  740. Settings:AddLabel("Sheriff Color")
  741. :AddColorPicker("Sheriff_Color", { Default = Colors.Sheriff });
  742. Settings:AddLabel("Hero Color")
  743. :AddColorPicker("Hero_Color", { Default = Colors.Hero });
  744. Settings:AddLabel("Unknown Color")
  745. :AddColorPicker("Unknown_Color", { Default = Colors.Unknown });
  746.  
  747. local function UpdateColors()
  748. Colors = {
  749. Innocent = Options.Innocent_Color.Value;
  750. Murderer = Options.Murderer_Color.Value;
  751. Sheriff = Options.Sheriff_Color.Value;
  752. Hero = Options.Hero_Color.Value;
  753. Unknown = Options.Unknown_Color.Value;
  754. Gun = Color3.new(255, 255, 0);
  755. }
  756. end
  757. Options.Innocent_Color:OnChanged(UpdateColors);
  758. Options.Murderer_Color:OnChanged(UpdateColors);
  759. Options.Sheriff_Color:OnChanged(UpdateColors);
  760. Options.Hero_Color:OnChanged(UpdateColors);
  761. Options.Unknown_Color:OnChanged(UpdateColors);
  762. end
  763.  
  764. do -- World Render
  765. local Container = Tab:AddRightGroupbox("World Render");
  766. Container:AddLabel("Work in progress");
  767. end
  768. end
  769.  
  770. do -- Settings
  771. local Tab = Window:AddTab("Settings");
  772.  
  773. local function UpdateTheme()
  774. Library.BackgroundColor = Options.BackgroundColor.Value;
  775. Library.MainColor = Options.MainColor.Value;
  776. Library.AccentColor = Options.AccentColor.Value;
  777. Library.AccentColorDark = Library:GetDarkerColor(Library.AccentColor);
  778. Library.OutlineColor = Options.OutlineColor.Value;
  779. Library.FontColor = Options.FontColor.Value;
  780.  
  781. Library:UpdateColorsUsingRegistry();
  782. end;
  783.  
  784. local function SetDefault()
  785. Options.FontColor:SetValueRGB(Color3.fromRGB(255, 255, 255));
  786. Options.MainColor:SetValueRGB(Color3.fromRGB(28, 28, 28));
  787. Options.BackgroundColor:SetValueRGB(Color3.fromRGB(20, 20, 20));
  788. Options.AccentColor:SetValueRGB(Color3.fromRGB(0, 85, 255));
  789. Options.OutlineColor:SetValueRGB(Color3.fromRGB(50, 50, 50));
  790. Toggles.Rainbow:SetValue(false);
  791.  
  792. UpdateTheme();
  793. end;
  794.  
  795. local Theme = Tab:AddLeftGroupbox("Theme");
  796. Theme:AddLabel("Background Color"):AddColorPicker("BackgroundColor", { Default = Library.BackgroundColor });
  797. Theme:AddLabel("Main Color"):AddColorPicker("MainColor", { Default = Library.MainColor });
  798. Theme:AddLabel("Accent Color"):AddColorPicker("AccentColor", { Default = Library.AccentColor });
  799. Theme:AddToggle("Rainbow", { Text = "Rainbow Accent Color" });
  800. Theme:AddLabel("Outline Color"):AddColorPicker("OutlineColor", { Default = Library.OutlineColor });
  801. Theme:AddLabel("Font Color"):AddColorPicker("FontColor", { Default = Library.FontColor });
  802. Theme:AddButton("Default Theme", SetDefault);
  803. Theme:AddToggle("Keybinds", { Text = "Show Keybinds Menu", Default = true }):OnChanged(function()
  804. Library.KeybindFrame.Visible = Toggles.Keybinds.Value;
  805. end);
  806. Theme:AddToggle("Watermark", { Text = "Show Watermark", Default = true }):OnChanged(function()
  807. Library:SetWatermarkVisibility(Toggles.Watermark.Value);
  808. end);
  809.  
  810. task.spawn(function()
  811. while game:GetService("RunService").RenderStepped:Wait() do
  812. if Toggles.Rainbow.Value then
  813. local Registry = Window.Holder.Visible and Library.Registry or Library.HudRegistry;
  814.  
  815. for Idx, Object in next, Registry do
  816. for Property, ColorIdx in next, Object.Properties do
  817. if ColorIdx == "AccentColor" or ColorIdx == "AccentColorDark" then
  818. local Instance = Object.Instance;
  819. local yPos = Instance.AbsolutePosition.Y;
  820.  
  821. local Mapped = Library:MapValue(yPos, 0, 1080, 0, 0.5) * 1.5;
  822. local Color = Color3.fromHSV((Library.CurrentRainbowHue - Mapped) % 1, 0.8, 1);
  823.  
  824. if ColorIdx == "AccentColorDark" then
  825. Color = Library:GetDarkerColor(Color);
  826. end;
  827.  
  828. Instance[Property] = Color;
  829. end;
  830. end;
  831. end;
  832. end;
  833. end;
  834. end);
  835.  
  836. Toggles.Rainbow:OnChanged(function()
  837. if not Toggles.Rainbow.Value then
  838. UpdateTheme();
  839. end;
  840. end);
  841.  
  842. Options.BackgroundColor:OnChanged(UpdateTheme);
  843. Options.MainColor:OnChanged(UpdateTheme);
  844. Options.AccentColor:OnChanged(UpdateTheme);
  845. Options.OutlineColor:OnChanged(UpdateTheme);
  846. Options.FontColor:OnChanged(UpdateTheme);
  847. end
  848.  
  849. task.delay(Random.new():NextNumber(0.5, 2), function()
  850. Library:Notify("Loaded UI!")
  851. Library:Notify("Loaded [Murder Mystery 2]")
  852. end);
  853.  
  854. -- Listeners:
  855. workspace:GetPropertyChangedSignal("CurrentCamera"):Connect(function()
  856. Camera = workspace.CurrentCamera
  857. end)
  858. workspace.ChildAdded:Connect(function(child)
  859. if child.Name == "GunDrop" then
  860. child.AncestryChanged:Connect(function(_, parent)
  861. if not parent then ManualUpdate() end
  862. end)
  863. end
  864. end)
  865. Players.PlayerAdded:Connect(function(Player: Player)
  866. Player.CharacterAdded:Connect(function(Character)
  867. Character:WaitForChild("Humanoid");
  868. local HumanoidRootPart = Character:WaitForChild("HumanoidRootPart");
  869. DrawingESP.new(Player, Player.Name, Colors.Unknown)
  870. Radar:CreateDot(HumanoidRootPart, Colors.Unknown)
  871. end)
  872. Roles[Player] = "Unknown";
  873. ManualUpdate()
  874. end)
  875. Players.PlayerRemoving:Connect(function(Player: Player)
  876. Roles[Player] = nil;
  877. end)
  878. ReplicatedStorage.Fade.OnClientEvent:Connect(function(Value)
  879. for i,v in ipairs(Players:GetPlayers()) do
  880. if v ~= LocalPlayer then
  881. pcall(UpdateRole, v, Value[v.Name])
  882. end
  883. end
  884. end)
  885. ReplicatedStorage.UpdatePlayerData.OnClientEvent:Connect(function(Value)
  886. for i,v in ipairs(Players:GetPlayers()) do
  887. if v ~= LocalPlayer then
  888. pcall(UpdateRole, v, Value[v.Name])
  889. end
  890. end
  891. end)
  892. ReplicatedStorage.RoleSelect.OnClientEvent:Connect(function(Role, ...) UpdateRole(LocalPlayer, Role) end)
  893. ReplicatedStorage.Remotes.Gameplay.RoundEndFade.OnClientEvent:Connect(function()
  894. UpdateRole(Murderer, "Innocent"); UpdateRole(Murderer, "Innocent");
  895. end)
  896.  
  897. local lastSprintState = false;
  898. local lastCalloutState = false;
  899. RunService.RenderStepped:Connect(function(deltaTime)
  900. if Toggles.Callouts.Value and Murderer ~= LocalPlayer and (Roles[LocalPlayer] == "Innocent" or Roles[LocalPlayer] == "Unknown") then
  901. if lastCalloutState == false and Options.Callouts:GetState() then
  902. local Message = Options.CalloutMessage.Value:gsub("${Player}", Murderer.Name)
  903. ReplicatedStorage.DefaultChatSystemChatEvents.SayMessageRequest:FireServer(
  904. Message,
  905. "normalchat"
  906. )
  907. end
  908. end
  909. lastCalloutState = Options.Callouts:GetState();
  910.  
  911. local Character = LocalPlayer.Character
  912. if ValidCharacter(Character) then
  913. if Toggles.Reach.Value then
  914. local Knife = Character:FindFirstChild("Knife")
  915. if Knife and Knife:IsA("Tool") then
  916. local HumanoidRootPart = Character.HumanoidRootPart;
  917. for i,v in ipairs(Players:GetPlayers()) do
  918. if v ~= LocalPlayer and ValidCharacter(v.Character) then
  919. local EnemyRoot = v.Character.HumanoidRootPart;
  920. local EnemyPosition = EnemyRoot.Position;
  921. local Distance = (EnemyPosition - HumanoidRootPart.Position).Magnitude;
  922. local Angle = AngleDistance(
  923. HumanoidRootPart.CFrame.LookVector.Unit,
  924. (EnemyPosition - HumanoidRootPart.Position).Unit
  925. );
  926. if Distance <= Options.Reach.Value and Angle <= Options.ReachAngle.Value then
  927. firetouchinterest(EnemyRoot, Knife.Handle, 1)
  928. firetouchinterest(EnemyRoot, Knife.Handle, 0)
  929. end
  930. end
  931. end
  932. end
  933. end
  934.  
  935. do
  936. local SpeedState = Options.SpeedHack:GetState()
  937. if Toggles.SpeedHack.Value and SpeedState ~= lastSprintState then
  938. if SpeedState then
  939. Character.Humanoid.WalkSpeed = 16 + Options.Speed.Value;
  940. else
  941. Character.Humanoid.WalkSpeed = 16;
  942. end
  943. end
  944. lastSprintState = SpeedState
  945. end
  946. end
  947.  
  948. Box.Adornee = workspace:FindFirstChild("GunDrop")
  949.  
  950. for i,v in pairs(DrawingESP.RunningESPs) do
  951. v.Visible = Toggles.ESP.Value
  952. v:ChangeColor(Colors[Roles[v._Player]] or Colors.Unknown)
  953. end
  954. Radar.Visible = Toggles.Radar.Value
  955. end)
  956.  
  957. -- Hooks:
  958. local __namecall;
  959. __namecall = hookmetamethod(game, "__namecall", function(self, ...)
  960. local method = getnamecallmethod()
  961. local args = { ... }
  962. if not checkcaller() and typeof(self) == "Instance" then
  963. if tostring(self) == "ShootGun" and method == "InvokeServer" then
  964. if Murderer and Toggles.SilentAim.Value and Options.SilentAim:GetState() then
  965. local PrimaryPart = Murderer.Character.PrimaryPart
  966. local Velocity = PrimaryPart.AssemblyLinearVelocity
  967. local Prediction = PrimaryPart.Position + (Velocity * Vector3.new(0.2, 0.1, 0.2))
  968. args[2] = Prediction
  969. end
  970. end
  971. end
  972. return __namecall(self, unpack(args))
  973. end)
  974.  
  975. -- Actions:
  976. local Data = ReplicatedStorage.GetPlayerData:InvokeServer()
  977. for i,v in ipairs(Players:GetPlayers()) do
  978. if v ~= LocalPlayer then
  979. pcall(UpdateRole, v, Data[v.Name])
  980. v.CharacterAdded:Connect(function(Character)
  981. Character:WaitForChild("Humanoid");
  982. local HumanoidRootPart = Character:WaitForChild("HumanoidRootPart");
  983. DrawingESP.new(v, v.Name, Colors.Unknown);
  984. Radar:CreateDot(HumanoidRootPart, Colors.Unknown);
  985. end)
  986. end
  987. end
  988.  
  989. -- Exports:
  990. return {};
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement