Prokri43

Thusky lock

Aug 10th, 2023 (edited)
16
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.59 KB | None | 0 0
  1. --Thusky NEW PURPLE LOCK
  2.  
  3.  
  4.  
  5.  
  6. local Settings = {
  7. AimLock = {
  8. Enabled = true,
  9. Aimlockkey = "q",
  10. Prediction = 0.120,
  11. Aimpart = 'HumanoidRootPart',
  12. Notifications = false
  13. },
  14. Settings = {
  15. Thickness = 3.5,
  16. Transparency = 1,
  17. Color = Color3.fromRGB(153, 50, 204),
  18. FOV = true
  19. }
  20.  
  21. }
  22.  
  23. local CurrentCamera = game:GetService("Workspace").CurrentCamera
  24. local Inset = game:GetService("GuiService"):GetGuiInset().Y
  25. local RunService = game:GetService("RunService")
  26.  
  27. local Mouse = game.Players.LocalPlayer:GetMouse()
  28. local LocalPlayer = game.Players.LocalPlayer
  29.  
  30. local Line = Drawing.new("Line")
  31. local Circle = Drawing.new("Circle")
  32.  
  33. local Plr
  34.  
  35. Mouse.KeyDown:Connect(function(KeyPressed)
  36. if KeyPressed == (Settings.AimLock.Aimlockkey) then
  37. if Settings.AimLock.Enabled == true then
  38. Settings.AimLock.Enabled = false
  39. if Settings.AimLock.Notifications == true then
  40. Plr = FindClosestPlayer()
  41. game.StarterGui:SetCore("SendNotification", {
  42. Title = "Private",
  43. Text = "Unlocked"
  44. })
  45. end
  46. else
  47. Plr = FindClosestPlayer()
  48. Settings.AimLock.Enabled = true
  49. if Settings.AimLock.Notifications == true then
  50. game.StarterGui:SetCore("SendNotification", {
  51. Title = "Private",
  52. Text = "Locked On : " .. tostring(Plr.Character.Humanoid.DisplayName)
  53. })
  54. end
  55. end
  56. end
  57. end)
  58.  
  59. function FindClosestPlayer()
  60. local ClosestDistance, ClosestPlayer = math.huge, nil;
  61. for _, Player in next, game:GetService("Players"):GetPlayers() do
  62. local ISNTKNOCKED = Player.Character:WaitForChild("BodyEffects")["K.O"].Value ~= true
  63. local ISNTGRABBED = Player.Character:FindFirstChild("GRABBING_COINSTRAINT") == nil
  64.  
  65. if Player ~= LocalPlayer then
  66. local Character = Player.Character
  67. if Character and Character.Humanoid.Health > 1 and ISNTKNOCKED and ISNTGRABBED then
  68. local Position, IsVisibleOnViewPort = CurrentCamera:WorldToViewportPoint(Character.HumanoidRootPart
  69. .Position)
  70. if IsVisibleOnViewPort then
  71. local Distance = (Vector2.new(Mouse.X, Mouse.Y) - Vector2.new(Position.X, Position.Y)).Magnitude
  72. if Distance < ClosestDistance then
  73. ClosestPlayer = Player
  74. ClosestDistance = Distance
  75. end
  76. end
  77. end
  78. end
  79. end
  80. return ClosestPlayer, ClosestDistance
  81. end
  82.  
  83. RunService.Heartbeat:connect(function()
  84. if Settings.AimLock.Enabled == true then
  85. local Vector = CurrentCamera:WorldToViewportPoint(Plr.Character[Settings.AimLock.Aimpart].Position +
  86. (Plr.Character[Settings.AimLock.Aimpart].Velocity *
  87. Settings.AimLock.Prediction))
  88. Line.Color = Settings.Settings.Color
  89. Line.Transparency = Settings.Settings .Transparency
  90. Line.Thickness = Settings.Settings .Thickness
  91. Line.From = Vector2.new(Mouse.X, Mouse.Y + Inset)
  92. Line.To = Vector2.new(Vector.X, Vector.Y)
  93. Line.Visible = true
  94. Circle.Position = Vector2.new(Mouse.X, Mouse.Y + Inset)
  95. Circle.Visible = Settings.Settings.FOV
  96. Circle.Thickness = 1.5
  97. Circle.Thickness = 2
  98. Circle.Radius = 60
  99. Circle.Color = Settings.Settings.Color
  100.  
  101. else
  102. Line.Visible = false
  103. Circle.Visible = false
  104. end
  105. end)
  106.  
  107. local mt = getrawmetatable(game)
  108. local old = mt.__namecall
  109. setreadonly(mt, false)
  110. mt.__namecall = newcclosure(function(...)
  111. local args = {...}
  112. if Settings.AimLock.Enabled and getnamecallmethod() == "FireServer" and args[2] == "UpdateMousePos" then
  113. args[3] = Plr.Character[Settings.AimLock.Aimpart].Position +
  114. (Plr.Character[Settings.AimLock.Aimpart].Velocity * Settings.AimLock.Prediction)
  115.  
  116. return old(unpack(args))
  117. end
  118. return old(...)
  119. end)
  120.  
  121. local Settings = {
  122. AimLock = {
  123. Enabled = true,
  124. Aimlockkey = "q",
  125. Prediction = 0.113,
  126. Aimpart = 'HumanoidRootPart',
  127. Notifications = false
  128. },
  129. Settings = {
  130. Thickness = 3.5,
  131. Transparency = 1,
  132. Color = Color3.fromRGB(153, 50, 204),
  133. FOV = true
  134. }
  135.  
  136. }
  137.  
  138. local CurrentCamera = game:GetService("Workspace").CurrentCamera
  139. local Inset = game:GetService("GuiService"):GetGuiInset().Y
  140. local RunService = game:GetService("RunService")
  141.  
  142. local Mouse = game.Players.LocalPlayer:GetMouse()
  143. local LocalPlayer = game.Players.LocalPlayer
  144.  
  145. local Line = Drawing.new("Line")
  146. local Circle = Drawing.new("Circle")
  147.  
  148. local Plr
  149.  
  150. Mouse.KeyDown:Connect(function(KeyPressed)
  151. if KeyPressed == (Settings.AimLock.Aimlockkey) then
  152. if Settings.AimLock.Enabled == true then
  153. Settings.AimLock.Enabled = false
  154. if Settings.AimLock.Notifications == true then
  155. Plr = FindClosestPlayer()
  156. game.StarterGui:SetCore("SendNotification", {
  157. Title = "Private",
  158. Text = "Unlocked"
  159. })
  160. end
  161. else
  162. Plr = FindClosestPlayer()
  163. Settings.AimLock.Enabled = true
  164. if Settings.AimLock.Notifications == true then
  165. game.StarterGui:SetCore("SendNotification", {
  166. Title = "Private",
  167. Text = "Locked On : " .. tostring(Plr.Character.Humanoid.DisplayName)
  168. })
  169. end
  170. end
  171. end
  172. end)
  173.  
  174. function FindClosestPlayer()
  175. local ClosestDistance, ClosestPlayer = math.huge, nil;
  176. for _, Player in next, game:GetService("Players"):GetPlayers() do
  177. local ISNTKNOCKED = Player.Character:WaitForChild("BodyEffects")["K.O"].Value ~= true
  178. local ISNTGRABBED = Player.Character:FindFirstChild("GRABBING_COINSTRAINT") == nil
  179.  
  180. if Player ~= LocalPlayer then
  181. local Character = Player.Character
  182. if Character and Character.Humanoid.Health > 1 and ISNTKNOCKED and ISNTGRABBED then
  183. local Position, IsVisibleOnViewPort = CurrentCamera:WorldToViewportPoint(Character.HumanoidRootPart
  184. .Position)
  185. if IsVisibleOnViewPort then
  186. local Distance = (Vector2.new(Mouse.X, Mouse.Y) - Vector2.new(Position.X, Position.Y)).Magnitude
  187. if Distance < ClosestDistance then
  188. ClosestPlayer = Player
  189. ClosestDistance = Distance
  190. end
  191. end
  192. end
  193. end
  194. end
  195. return ClosestPlayer, ClosestDistance
  196. end
  197.  
  198. RunService.Heartbeat:connect(function()
  199. if Settings.AimLock.Enabled == true then
  200. local Vector = CurrentCamera:WorldToViewportPoint(Plr.Character[Settings.AimLock.Aimpart].Position +
  201. (Plr.Character[Settings.AimLock.Aimpart].Velocity *
  202. Settings.AimLock.Prediction))
  203. Line.Color = Settings.Settings.Color
  204. Line.Transparency = Settings.Settings .Transparency
  205. Line.Thickness = Settings.Settings .Thickness
  206. Line.From = Vector2.new(Mouse.X, Mouse.Y + Inset)
  207. Line.To = Vector2.new(Vector.X, Vector.Y)
  208. Line.Visible = true
  209. Circle.Position = Vector2.new(Mouse.X, Mouse.Y + Inset)
  210. Circle.Visible = Settings.Settings.FOV
  211. Circle.Thickness = 1.5
  212. Circle.Thickness = 2
  213. Circle.Radius = 60
  214. Circle.Color = Settings.Settings.Color
  215.  
  216. else
  217. Line.Visible = false
  218. Circle.Visible = false
  219. end
  220. end)
  221.  
  222. local mt = getrawmetatable(game)
  223. local old = mt.__namecall
  224. setreadonly(mt, false)
  225. mt.__namecall = newcclosure(function(...)
  226. local args = {...}
  227. if Settings.AimLock.Enabled and getnamecallmethod() == "FireServer" and args[2] == "UpdateMousePos" then
  228. args[3] = Plr.Character[Settings.AimLock.Aimpart].Position +
  229. (Plr.Character[Settings.AimLock.Aimpart].Velocity * Settings.AimLock.Prediction)
  230.  
  231. return old(unpack(args))
  232. end
  233. return old(...)
  234. end)
  235.  
Add Comment
Please, Sign In to add comment