NukeVsCity

The Wild West Gui #2

Feb 15th, 2021
3,585
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.75 KB | None | 0 0
  1. local Lighting = game:GetService("Lighting");
  2. local Players = game:GetService("Players");
  3. local ReplicatedStorage = game:GetService("ReplicatedStorage");
  4. local ScriptContext = game:GetService("ScriptContext");
  5.  
  6. for _, connection in ipairs(getconnections(ScriptContext.Error)) do
  7. connection:Disable();
  8. end
  9.  
  10. local library = loadstring(game:HttpGet("https://paste.ee/r/omZtZ/0", true))();
  11.  
  12. local camera = workspace.CurrentCamera;
  13. local client = Players.LocalPlayer;
  14.  
  15. local LoadModule = require(ReplicatedStorage.Modules.Load);
  16. local LoadSharedModule = require(ReplicatedStorage.SharedModules.Load);
  17. local AnimalModule, BreakableGlassModule, CameraModule, ClientProjectiles, GunItemModule, NetworkModule, PlayerCharacterModule, SharedUtilsModule, UtilsModule; do
  18. AnimalModule = LoadModule("Animal");
  19. BreakableGlassModule = LoadModule("BreakableGlass");
  20. CameraModule = LoadModule("Camera");
  21. ClientProjectiles = LoadModule("ClientProjectiles");
  22. GunItemModule = LoadModule("GunItem");
  23. NetworkModule = LoadSharedModule("Network");
  24. PlayerCharacterModule = LoadModule("PlayerCharacter");
  25. SharedUtilsModule = LoadSharedModule("SharedUtils");
  26. UtilsModule = LoadModule("Utils");
  27. end
  28.  
  29. local GetClosestCharacter = function()
  30. local ClosestCharacter;
  31. local closest = math.huge;
  32.  
  33. local center = camera.ViewportSize / 2;
  34.  
  35. for _, player in ipairs(Players:GetPlayers()) do
  36. if (player ~= client) then
  37. local character = player.Character;
  38.  
  39. if (character) then
  40. local vector, visible = camera:WorldToViewportPoint(character.Head.Position);
  41.  
  42. if (visible) then
  43. local distance = (Vector2.new(vector.X, vector.Y) - center).Magnitude;
  44.  
  45. if (distance < closest) then
  46. ClosestCharacter = character;
  47. closest = distance;
  48. end
  49. end
  50. end
  51. end
  52. end
  53.  
  54. return ClosestCharacter;
  55. end
  56.  
  57. local OldFireServer = NetworkModule.FireServer;
  58. NetworkModule.FireServer = function(self, remote, ...)
  59. if (library.flags.InfiniteStamina and remote == "LowerStamina") then return end;
  60. if (library.flags.NoFallDamage and remote == "DamageSelf") then return end;
  61.  
  62. return OldFireServer(self, remote, ...)
  63. end
  64.  
  65. --// Character
  66.  
  67. local OldCharacterRagdoll = PlayerCharacterModule.Ragdoll;
  68. PlayerCharacterModule.Ragdoll = function(...)
  69. if (library.flags.NoCharacterRagdoll) then return end;
  70.  
  71. return OldCharacterRagdoll(...);
  72. end
  73.  
  74. local JumpConnection = client.Character and getconnections(client.Character.Humanoid:GetPropertyChangedSignal("Jump"))[1];
  75. local OldOnCharacterAdded = PlayerCharacterModule.OnCharacterAdded;
  76. PlayerCharacterModule.OnCharacterAdded = function(self)
  77. OldOnCharacterAdded(self);
  78. JumpConnection = getconnections(self.Human:GetPropertyChangedSignal("Jump"))[1];
  79. if (library.flags.NoJumpCooldown) then
  80. JumpConnection:Disable();
  81. end
  82. end
  83.  
  84. local OldBreakFree = PlayerCharacterModule.BreakFree;
  85. PlayerCharacterModule.BreakFree = function(self)
  86. if (library.flags.InstantBreakFree) then
  87. self.BreakFreePerc = 1;
  88. end
  89. return OldBreakFree(self);
  90. end
  91.  
  92. local OldGetUp = PlayerCharacterModule.GetUp;
  93. PlayerCharacterModule.GetUp = function(self)
  94. if (library.flags.InstantGetUp) then
  95. local a, b = NetworkModule:InvokeServer("AttemptGetUp");
  96. self:OnGetUp(a, b);
  97. return;
  98. end
  99.  
  100. return OldGetUp(self);
  101. end
  102.  
  103. --// Combat
  104.  
  105. local OldIsFirstPerson = CameraModule.IsFirstPerson;
  106. CameraModule.IsFirstPerson = function(self)
  107. if (library.flags.SilentAim) then
  108. if (getfenv(2) == getfenv(GunItemModule.new)) then
  109. return true;
  110. end
  111. end
  112.  
  113. return OldIsFirstPerson(self);
  114. end
  115.  
  116. local OldGetMouseHit = UtilsModule.GetMouseHit;
  117. UtilsModule.GetMouseHit = function(...)
  118. local args = {...};
  119.  
  120. if (library.flags.SilentAim) then
  121. if (getfenv(2) == getfenv(GunItemModule.new)) then
  122. local ClosestCharacter = GetClosestCharacter();
  123.  
  124. if (ClosestCharacter) then
  125. return ClosestCharacter.Head.Position;
  126. end
  127. end
  128. end
  129.  
  130. return OldGetMouseHit(...);
  131. end
  132.  
  133. local OldCalculateRecoil = GunItemModule.CalculateRecoil;
  134. GunItemModule.CalculateRecoil = function(...)
  135. if (library.flags.NoRecoil) then return 0 end;
  136.  
  137. return OldCalculateRecoil(...);
  138. end
  139.  
  140. local OldGetProjectileSpread = SharedUtilsModule.GetProjectileSpread;
  141. SharedUtilsModule.GetProjectileSpread = function(a, b, c, d)
  142. if (library.flags.SilentAim or library.flags.NoSpread) then
  143. c.accuracy = 1;
  144. end
  145.  
  146. return OldGetProjectileSpread(a, b, c, d);
  147. end
  148.  
  149. local OldOnHit = ClientProjectiles.Projectiles.GunProjectile.OnHit;
  150. ClientProjectiles.Projectiles.GunProjectile.OnHit = function(self, ...)
  151. if (library.flags.InfiniteBulletPenetration) then
  152. local OldCheckPenetration = self.CheckPenetration;
  153.  
  154. self.CheckPenetration = function(self)
  155. self.PenetrationLeft = 999999;
  156.  
  157. return OldCheckPenetration(self);
  158. end
  159. end
  160.  
  161. return OldOnHit(self, ...);
  162. end
  163.  
  164. --// World
  165.  
  166. local OldAnimalRagdoll = AnimalModule.Ragdoll;
  167. AnimalModule.Ragdoll = function(self, ...)
  168. if (library.flags.NoHorseRagdoll) then return end;
  169.  
  170. return OldAnimalRagdoll(self, ...);
  171. end
  172.  
  173. local OldAnimalBoost = AnimalModule.Boost;
  174. AnimalModule.Boost = function(self)
  175. OldAnimalBoost(self);
  176.  
  177. if (library.flags.InfiniteBoosts) then
  178. self.Boosts = self.MaxBoosts;
  179. end
  180. end
  181.  
  182. --// Miscellaneous
  183.  
  184. local LightingChangedConnection;
  185. local Fullbright = function(state)
  186. if (state) then
  187. LightingChangedConnection = Lighting.Changed:Connect(function()
  188. local color = Color3.new(1, 1, 1);
  189. Lighting.Ambient = color;
  190. Lighting.ColorShift_Bottom = color;
  191. Lighting.ColorShift_Top = color;
  192. end)
  193. else
  194. LightingChangedConnection:Disconnect();
  195. end
  196. end
  197.  
  198. local BreakableGlass = {}; do
  199. for k, v in next, debug.getupvalue(BreakableGlassModule.GetBreakableGlass, 1) do
  200. if (type(k) == "userdata") then
  201. table.insert(BreakableGlass, v.Id);
  202. end
  203. end
  204. end
  205. local BreakAllGlass = function()
  206. for _, id in ipairs(BreakableGlass) do
  207. NetworkModule:FireServer("BreakGlass", id, Vector3.new());
  208. end
  209. end
  210.  
  211. local CharacterWindow = library:CreateWindow("Character"); do
  212. CharacterWindow:AddToggle({
  213. text = "No Ragdoll",
  214. flag = "NoCharacterRagdoll"
  215. })
  216.  
  217. CharacterWindow:AddToggle({
  218. text = "Infinite Stamina",
  219. flag = "InfiniteStamina"
  220. })
  221.  
  222. CharacterWindow:AddToggle({
  223. text = "No Fall Damage",
  224. flag = "NoFallDamage"
  225. })
  226.  
  227. CharacterWindow:AddToggle({
  228. text = "No Jump Cooldown",
  229. flag = "NoJumpCooldown",
  230. callback = function(state)
  231. if (JumpConnection) then
  232. if (state) then
  233. JumpConnection:Disable();
  234. else
  235. JumpConnection:Enable();
  236. end
  237. end
  238. end
  239. })
  240.  
  241. CharacterWindow:AddToggle({
  242. text = "Instant Break Free",
  243. flag = "InstantBreakFree"
  244. })
  245.  
  246. CharacterWindow:AddToggle({
  247. text = "Instant Get Up",
  248. flag = "InstantGetUp"
  249. })
  250. end
  251.  
  252. local GunWindow = library:CreateWindow("Gun"); do
  253. GunWindow:AddToggle({
  254. text = "Silent Aim",
  255. flag = "SilentAim"
  256. })
  257.  
  258. GunWindow:AddToggle({
  259. text = "No Recoil",
  260. flag = "NoRecoil"
  261. })
  262.  
  263. GunWindow:AddToggle({
  264. text = "No Spread",
  265. flag = "NoSpread"
  266. })
  267.  
  268. GunWindow:AddToggle({
  269. text = "Infinite Bullet Penetration",
  270. flag = "InfiniteBulletPenetration"
  271. })
  272. end
  273.  
  274. local HorseWindow = library:CreateWindow("Horse"); do
  275. HorseWindow:AddToggle({
  276. text = "No Ragdoll",
  277. flag = "NoHorseRagdoll"
  278. })
  279.  
  280. HorseWindow:AddToggle({
  281. text = "Infinite Boosts",
  282. flag = "InfiniteBoosts"
  283. })
  284. end
  285.  
  286. local MiscellaneousWindow = library:CreateWindow("Miscellaneous"); do
  287. MiscellaneousWindow:AddToggle({
  288. text = "Fullbright",
  289. flag = "Fullbright",
  290. callback = Fullbright
  291. })
  292.  
  293. MiscellaneousWindow:AddButton({
  294. text = "Break All Glass",
  295. callback = BreakAllGlass
  296. })
  297.  
  298. MiscellaneousWindow:AddBind({
  299. text = "UI Visible",
  300. key = "RightShift",
  301. callback = function()
  302. library:Close();
  303. end
  304. })
  305. end
  306.  
  307. library:Init();
Add Comment
Please, Sign In to add comment