Advertisement
_Thanh_Thy_Cute_

Prison Life SILENT AIM

Jun 5th, 2021
10,145
-1
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.33 KB | None | 0 1
  1. -- // Constants \\ --
  2. -- [ Services ] --
  3. local Services = setmetatable({}, {__index = function(Self, Index)
  4. local NewService = game.GetService(game, Index)
  5. if NewService then
  6. Self[Index] = NewService
  7. end
  8. return NewService
  9. end})
  10.  
  11. -- [ Modules ] --
  12. local UserInterface = loadstring(game:HttpGet("https://raw.githubusercontent.com/icuck/collection-dump/main/AbstractUI", true))()
  13. local Drawing = loadstring(game:HttpGet("https://raw.githubusercontent.com/iHavoc101/Genesis-Studios/main/Modules/DrawingAPI.lua", true))()
  14.  
  15. local ToolTip = require(Services.ReplicatedStorage.Modules_client.TooltipModule)
  16.  
  17. -- [ LocalPlayer ] --
  18. local LocalPlayer = Services.Players.LocalPlayer
  19. local Camera = workspace.CurrentCamera
  20.  
  21. -- [ Raycast Parameters ] --
  22. local RaycastParameters = RaycastParams.new()
  23. RaycastParameters.IgnoreWater = true
  24. RaycastParameters.FilterType = Enum.RaycastFilterType.Blacklist
  25. RaycastParameters.FilterDescendantsInstances = {LocalPlayer.Character}
  26.  
  27. -- // Variables \\ --
  28. -- [ Info ] --
  29. local Info = {
  30. SilentAIMEnabled = false;
  31. TriggeredEnabled = false;
  32. ArmsCheckEnabled = true;
  33. TeamWhitelist = "";
  34. FieldOfView = 250;
  35. }
  36.  
  37. local LastArrest = time()
  38.  
  39. -- [ Interface ] --
  40. local FOVCircle = Drawing.new("Circle", {
  41. Thickness = 2.5,
  42. Color = Color3.fromRGB(200, 200, 200),
  43. NumSides = 25,
  44. Radius = _G.FOV
  45. })
  46.  
  47. local Target = Drawing.new("Triangle", {
  48. Thickness = 5,
  49. Color = Color3.fromRGB(0, 200, 255)
  50. })
  51.  
  52. -- [ Weapons ] --
  53. local Weapons = {
  54. "Remington 870";
  55. "AK-47";
  56. "M9";
  57. "M4A1";
  58. "Hammer";
  59. "Crude Knife";
  60. }
  61.  
  62. -- [ Metatable ] --
  63. local RawMetatable = getrawmetatable(game)
  64. local __NameCall = RawMetatable.__namecall
  65. local __Index = RawMetatable.__index
  66.  
  67.  
  68. -- // Functions \\ --
  69. local function ValidCharacter(Character)
  70. return Character and (Character.FindFirstChildWhichIsA(Character, "Humanoid") and Character.FindFirstChildWhichIsA(Character, "Humanoid").Health ~= 0) or false
  71. end
  72.  
  73. local function NotObstructing(Destination, Ancestor)
  74. -- [ Camera ] --
  75. local ObstructingParts = Camera.GetPartsObscuringTarget(Camera, {Destination}, {Ancestor, LocalPlayer.Character})
  76.  
  77. for i,v in ipairs(ObstructingParts) do
  78. pcall(function()
  79. if v.Transparency >= 1 then
  80. table.remove(ObstructingParts, i)
  81. end
  82. end)
  83. end
  84.  
  85. if #ObstructingParts <= 0 then
  86. return true
  87. end
  88.  
  89. -- [ Raycast ] --
  90. RaycastParameters.FilterDescendantsInstances = {LocalPlayer.Character}
  91.  
  92. local Origin = Camera.CFrame.Position
  93. local Direction = (Destination - Origin).Unit * 500
  94. local RayResult = workspace.Raycast(workspace, Origin, Direction, RaycastParameters) or {
  95. Instance = nil;
  96. Position = Origin + Direction;
  97. Material = Enum.Material.Air;
  98. }
  99.  
  100. if RayResult.Instance and (RayResult.Instance.IsDescendantOf(RayResult.Instance, Ancestor) or RayResult.Instance == Ancestor) then
  101. return true
  102. end
  103.  
  104. -- [ Obstructed ] --
  105. return false
  106. end
  107.  
  108. local function IsArmed(Player)
  109. for i,v in ipairs(Weapons) do
  110. local Tool = Player.Backpack.FindFirstChild(Player.Backpack, v) or Player.Character.FindFirstChild(Player.Character, v)
  111. if Tool then
  112. return true
  113. end
  114. end
  115. return false
  116. end
  117.  
  118. local function ClosestPlayerToCursor(Distance)
  119. local Closest = nil
  120. local Position = nil
  121. local ShortestDistance = Distance or math.huge
  122.  
  123. local MousePosition = Services.UserInputService.GetMouseLocation(Services.UserInputService)
  124.  
  125. for i, v in ipairs(Services.Players.GetPlayers(Services.Players)) do
  126. if v ~= LocalPlayer and (v.Team ~= LocalPlayer.Team and tostring(v.Team) ~= Info.TeamWhitelist) and ValidCharacter(v.Character) then
  127. if Info.ArmsCheckEnabled and (v.Team == Services.Teams.Inmates and IsArmed(v) == false) then
  128. continue
  129. end
  130.  
  131. local ViewportPosition, OnScreen = Camera.WorldToViewportPoint(Camera, v.Character.PrimaryPart.Position)
  132. local Magnitude = (Vector2.new(ViewportPosition.X, ViewportPosition.Y) - MousePosition).Magnitude
  133.  
  134. if OnScreen == false or NotObstructing(v.Character.PrimaryPart.Position, v.Character) == false then
  135. continue
  136. end
  137.  
  138. if Magnitude < ShortestDistance then
  139. Closest = v
  140. Position = ViewportPosition
  141. ShortestDistance = Magnitude
  142. end
  143. end
  144. end
  145.  
  146. return Closest, Position
  147. end
  148.  
  149. local function SwitchGuns()
  150. if LocalPlayer.Character.FindFirstChild(LocalPlayer.Character, "Remington 870") then
  151. local Tool = LocalPlayer.Backpack.FindFirstChild(LocalPlayer.Backpack, "M4A1") or LocalPlayer.Backpack.FindFirstChild(LocalPlayer.Backpack, "AK-47") or LocalPlayer.Backpack.FindFirstChild(LocalPlayer.Backpack, "M9")
  152.  
  153. local Humanoid = LocalPlayer.Character.FindFirstChildWhichIsA(LocalPlayer.Character, "Humanoid")
  154. Humanoid.EquipTool(Humanoid, Tool)
  155. else
  156. local Tool = LocalPlayer.Backpack.FindFirstChild(LocalPlayer.Backpack, "Remington 870")
  157.  
  158. local Humanoid = LocalPlayer.Character.FindFirstChildWhichIsA(LocalPlayer.Character, "Humanoid")
  159. Humanoid.EquipTool(Humanoid, Tool)
  160. end
  161. end
  162.  
  163. local function Crash(Gun, BulletCount, ShotCount)
  164. local ShootEvent = Services.ReplicatedStorage.ShootEvent
  165. local StartTime = time()
  166. local BulletTable = {}
  167.  
  168. for i = 1, BulletCount do
  169. BulletTable[i] = {
  170. Cframe = CFrame.new(),
  171. Distance = math.huge
  172. }
  173. end
  174. for i = 1, ShotCount do
  175. ShootEvent:FireServer(BulletTable, Gun)
  176. if time() - StartTime > 5 then
  177. break
  178. end
  179. end
  180. end
  181.  
  182. -- // User Interface \\ --
  183. -- [ Window ] --
  184. local Window = UserInterface.new("Confinement X", UDim2.new(0, 420, 0, 420))
  185.  
  186. -- [ Assists ] --
  187. Window:Divider("Assists")
  188.  
  189. Window:Toggle("Silent Aim", "Shoots toward the nearest player to your cursor.", false, function(State)
  190. Info.SilentAIMEnabled = State
  191. end)
  192.  
  193. Window:Toggle("Trigger Bot", "Press G to temporarily disable.", false, function(State)
  194. Info.TriggeredEnabled = State
  195. end)
  196.  
  197. Window:Slider("Field Of View", "Recommended: 250", 50, 500, 250, function(Value)
  198. Info.FieldOfView = Value
  199. end)
  200.  
  201. Window:Dropdown("Team Whitelist", "Team for Silent-Aim to ignore.", {"Guards", "Inmates", "Criminals"}, function(Value)
  202. Info.TeamWhitelist = Value
  203. end)
  204.  
  205. Window:Toggle("Danger Check", "Checks if an Inmate has gun.", false, function(State)
  206. Info.ArmsCheckEnabled = State
  207. end)
  208.  
  209. -- [ Rage ] --
  210. Window:Divider("Rage")
  211.  
  212. Window:Button("Kill All", "Kills everyone in-game", function()
  213. local GunScript = (LocalPlayer.Backpack:FindFirstChild("GunInterface", true) or LocalPlayer.Character:FindFirstChild("GunInterface", true))
  214. if GunScript then
  215. for i,v in ipairs(game.Players:GetPlayers()) do
  216. if v ~= LocalPlayer then
  217. local BulletInfo = {
  218. [1] = {
  219. ["RayObject"] = Ray.new(Vector3.new(845.555908, 101.429337, 2269.43945), Vector3.new(-391.152252, 8.65560055, -83.2166901)),
  220. ["Distance"] = 3.2524313926697,
  221. ["Cframe"] = CFrame.new(840.310791, 101.334137, 2267.87988, 0.0636406094, 0.151434347, -0.986416459, 0, 0.988420188, 0.151741937, 0.997972965, -0.00965694897, 0.0629036576),
  222. ["Hit"] = v.Character.Head
  223. },
  224. [2] = {
  225. ["RayObject"] = Ray.new(Vector3.new(845.555908, 101.429337, 2269.43945), Vector3.new(-392.481476, -8.44939327, -76.7261353)),
  226. ["Distance"] = 3.2699294090271,
  227. ["Cframe"] = CFrame.new(840.290466, 101.184189, 2267.93506, 0.0964837447, 0.0589403138, -0.993587971, 4.65661287e-10, 0.998245299, 0.0592165813, 0.995334625, -0.00571343815, 0.0963144377),
  228. ["Hit"] = v.Character.Head
  229. },
  230. [3] = {
  231. ["RayObject"] = Ray.new(Vector3.new(845.555908, 101.429337, 2269.43945), Vector3.new(-389.21701, -2.50536323, -92.2163162)),
  232. ["Distance"] = 3.1665518283844,
  233. ["Cframe"] = CFrame.new(840.338867, 101.236496, 2267.80371, 0.0166504811, 0.0941716284, -0.995416701, 1.16415322e-10, 0.995554805, 0.0941846818, 0.999861419, -0.00156822044, 0.0165764652),
  234. ["Hit"] = v.Character.Head
  235. },
  236. [4] = {
  237. ["RayObject"] = Ray.new(Vector3.new(845.555908, 101.429337, 2269.43945), Vector3.new(-393.353973, 3.13988972, -72.5452042)),
  238. ["Distance"] = 3.3218522071838,
  239. ["Cframe"] = CFrame.new(840.277222, 101.285957, 2267.9707, 0.117109694, 0.118740402, -0.985994935, -1.86264515e-09, 0.992826641, 0.119563118, 0.993119001, -0.0140019981, 0.116269611),
  240. ["Hit"] = v.Character.Head
  241. },
  242. [5] = {
  243. ["RayObject"] = Ray.new(Vector3.new(845.555908, 101.429337, 2269.43945), Vector3.new(-390.73172, 3.2097764, -85.5477524)),
  244. ["Distance"] = 3.222757101059,
  245. ["Cframe"] = CFrame.new(840.317993, 101.286423, 2267.86035, 0.0517584644, 0.123365127, -0.991010666, 0, 0.992340803, 0.123530701, 0.99865967, -0.00639375951, 0.0513620302),
  246. ["Hit"] = v.Character.Head
  247. }
  248. }
  249. Services.ReplicatedStorage.ShootEvent:FireServer(BulletInfo, GunScript.Parent)
  250. Services.ReplicatedStorage.ShootEvent:FireServer(BulletInfo, GunScript.Parent)
  251. end
  252. end
  253. else
  254. ToolTip.update("No gun found!")
  255. end
  256. end)
  257.  
  258. Window:Button("Gun Modification", "Modifies the current gun you are holding.", function()
  259. local GunStates = LocalPlayer.Character:FindFirstChild("GunStates", true)
  260. if GunStates then
  261. local GunInfo = require(GunStates)
  262. GunInfo.ReloadTime = 0
  263. GunInfo.FireRate = 0
  264. GunInfo.AutoFire = true
  265. GunInfo.StoredAmmo = math.huge
  266. GunInfo.MaxAmmo = math.huge
  267. GunInfo.CurrentAmmo = math.huge
  268. end
  269. end)
  270.  
  271. -- [ Miscellaneous ] --
  272. Window:Divider("Miscellaneous")
  273.  
  274. Window:Button("Get Guns", "Grabs all", function()
  275. local HasSWAT = Services.MarketplaceService:UserOwnsGamePassAsync(LocalPlayer.UserId, 96651)
  276.  
  277. workspace.Remote.ItemHandler:InvokeServer(workspace.Prison_ITEMS.giver["Remington 870"].ITEMPICKUP)
  278. if HasSWAT then
  279. workspace.Remote.ItemHandler:InvokeServer(workspace.Prison_ITEMS.giver["M4A1"].ITEMPICKUP)
  280. end
  281. workspace.Remote.ItemHandler:InvokeServer(workspace.Prison_ITEMS.giver["AK-47"].ITEMPICKUP)
  282. workspace.Remote.ItemHandler:InvokeServer(workspace.Prison_ITEMS.giver["M9"].ITEMPICKUP)
  283.  
  284. if HasSWAT then
  285. workspace.Remote.ItemHandler:InvokeServer(workspace.Prison_ITEMS.clothes["Riot Police"].ITEMPICKUP)
  286. end
  287. end)
  288.  
  289. -- [ Credits ] --
  290. Window:Divider("Credits")
  291.  
  292. Window:Button("OminousVibes#7259", "Script Creator", function()
  293. setclipboard("OminousVibes#7259")
  294. end)
  295.  
  296.  
  297. -- // Metatable \\ --
  298. setreadonly(RawMetatable, false)
  299.  
  300. RawMetatable.__index = newcclosure(function(Self, Index)
  301. if Info.SilentAIMEnabled == true and checkcaller() == false then
  302. if typeof(Self) == "Instance" and (Self:IsA("PlayerMouse") or Self:IsA("Mouse")) then
  303. if Index == "Hit" then
  304. local Closest = ClosestPlayerToCursor(Info.FieldOfView)
  305. if Closest then
  306. local Velocity = Closest.Character.PrimaryPart.AssemblyLinearVelocity
  307. local Prediction = Velocity.Unit
  308. if Velocity.Magnitude == 0 then
  309. Prediction = Vector3.new(0, 0, 0)
  310. end
  311. return CFrame.new(Closest.Character.Head.Position + Prediction)
  312. end
  313. end
  314. end
  315. end
  316.  
  317. return __Index(Self, Index)
  318. end)
  319.  
  320.  
  321. setreadonly(RawMetatable, true)
  322.  
  323. -- // Event Listeners \\ --
  324. Services.RunService.RenderStepped:Connect(function()
  325. if Info.SilentAIMEnabled == true then
  326. -- FOV --
  327. FOVCircle.Visible = true
  328. FOVCircle.Radius = Info.FieldOfView
  329. FOVCircle.Position = Services.UserInputService:GetMouseLocation()
  330.  
  331. -- Target --
  332. local Closest, Position = ClosestPlayerToCursor(Info.FieldOfView)
  333. if Closest then
  334. Target.PointA = Vector2.new(Position.X - 25, Position.Y + 25)
  335. Target.PointB = Vector2.new(Position.X + 25, Position.Y + 25)
  336. Target.PointC = Vector2.new(Position.X, Position.Y - 25)
  337. if Info.TriggeredEnabled and not Services.UserInputService:IsKeyDown(Enum.KeyCode.G) then
  338. mouse1click()
  339. end
  340. end
  341. Target.Visible = Closest ~= nil
  342. else
  343. FOVCircle.Visible = false
  344. Target.Visible = false
  345. end
  346. end)
  347.  
  348. LocalPlayer.Chatted:Connect(function(Message)
  349. if string.find(Message:lower(), "-lag") then
  350. local GunScript = (LocalPlayer.Backpack:FindFirstChild("GunInterface", true) or LocalPlayer.Character:FindFirstChild("GunInterface", true))
  351. if GunScript then
  352. ToolTip.update("Lagging...")
  353. Crash(GunScript.Parent, 100, 10)
  354. ToolTip.update("Lagged!")
  355. else
  356. ToolTip.update("Error: No gun found!")
  357. end
  358. end
  359. end)
  360.  
  361. local LastShotDetected = time()
  362. for i,v in ipairs(getconnections(Services.ReplicatedStorage.ReplicateEvent.OnClientEvent)) do
  363. local OldFunction = v.Function
  364. v.Function = function(BulletStats, IsTaser)
  365. if #BulletStats > 25 or time() - LastShotDetected > 0.02 then
  366. ToolTip.update("Bullet Overload: Removing...")
  367. return
  368. end
  369. LastShotDetected = time()
  370. OldFunction(BulletStats, IsTaser)
  371. end
  372. end
  373.  
  374. local LastSoundDetected = time()
  375. for i,v in ipairs(getconnections(Services.ReplicatedStorage.SoundEvent.OnClientEvent)) do
  376. local OldFunction = v.Function
  377. v.Function = function(Sound)
  378. if time() - LastSoundDetected > 0.02 then
  379. ToolTip.update("Audio Overload: Removing...")
  380. return
  381. end
  382. LastSoundDetected = time()
  383. OldFunction(Sound)
  384. end
  385. end
  386.  
  387.  
  388. -- // KeyBinds \\ --
  389. Services.UserInputService.InputBegan:Connect(function(Input, GameProcessed)
  390. if _G.ArrestAssist == false or GameProcessed or LocalPlayer.Character:FindFirstChild("Handcuffs") == nil then
  391. return
  392. end
  393.  
  394. local Delta = time() - LastArrest
  395. if Delta <= 15 then
  396. ToolTip.update("Wait " .. tostring(math.floor(Delta)) .. " seconds before arresting again!")
  397. end
  398.  
  399. if Input.UserInputType == Enum.UserInputType.MouseButton1 then
  400. local Closest = ClosestPlayerToCursor(_G.FOV)
  401. if Closest then
  402. local Result = workspace.Remote.arrest:InvokeServer(Closest.Character.HumanoidRootPart)
  403. ToolTip.update(Result == true and "Successfully arrested!" or Result)
  404. if Result == true then
  405. LastArrest = time()
  406. end
  407. end
  408. end
  409. end)
  410.  
  411. Services.ContextActionService:BindAction("Switch Bind", function(actionName, InputState, inputObject)
  412. if InputState == Enum.UserInputState.End then
  413. return
  414. end
  415. pcall(SwitchGuns)
  416. end, false, Enum.KeyCode.Q)
  417.  
  418. -- // Actions \\ --
  419. LocalPlayer.PlayerGui.Home.fadeFrame.Visible = false
  420.  
  421. return {};
Advertisement
Comments
Add Comment
Please, Sign In to add comment
Advertisement