Advertisement
AERQ1111

ROBLOX town gun dMODIFICATIONS SCRIPT

Jun 27th, 2025 (edited)
219
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 5.65 KB | None | 0 0
  1. -- town gun modifications script (this will probably lag, most exploiter's pcs are potatoes so brace for impact)
  2. -- idk who would even use this script welp here it is
  3. local Players = game:GetService("Players")
  4. local player = Players.LocalPlayer
  5.  
  6. -- RENAME TOOLS
  7. local function renameAndUpdateTool(tool)
  8.     -- RENAME HK416 TO HK500 (why not)
  9.     if tool:IsA("Tool") and tool.Name == "HK416" then
  10.         tool.Name = "HK500"
  11.         print("Tool renamed to HK500")
  12.     end
  13.  
  14.     -- RENAME DESERT EAGLE TO PEW PEW GUN WOWWW
  15.     if tool:IsA("Tool") and tool.Name == "Desert Eagle" then
  16.         tool.Name = "Pew-Pew Gun"
  17.         print("Tool renamed to Pew-Pew Gun")
  18.     end
  19. end
  20.  
  21. -- UPDATE FIREOSUND D
  22. local function updateSounds(tool)
  23.     if tool:IsA("Tool") then
  24.         local handle = tool:FindFirstChild("Handle")
  25.         if handle and handle:IsA("BasePart") then
  26.             local fireSound = handle:FindFirstChild("FireSound")
  27.             local magInSound = handle:FindFirstChild("MagIn")
  28.  
  29.             -- UPDATE FIRESOUND HK
  30.             if tool.Name == "HK500" and fireSound and fireSound:IsA("Sound") then
  31.                 fireSound.SoundId = "rbxassetid://8234107515"
  32.                 print("FireSound updated for HK500")
  33.             end
  34.  
  35.             -- UPDATE FIRESOUND DEAGLE
  36.             if tool.Name == "Pew-Pew Gun" then
  37.                 if fireSound and fireSound:IsA("Sound") then
  38.                     fireSound.SoundId = "rbxassetid://2216910282"
  39.                     print("FireSound updated for Pew-Pew Gun")
  40.                 end
  41.                 if magInSound and magInSound:IsA("Sound") then
  42.                     magInSound.SoundId = "rbxassetid://8230941788"
  43.                     print("MagIn sound updated for Pew-Pew Gun")
  44.                 end
  45.             end
  46.         else
  47.             warn("Handle not found or invalid for tool:", tool.Name)
  48.         end
  49.     end
  50. end
  51.  
  52. -- UPDATE VIREWMODELOFFSET AND GUNS WEIGHTS
  53. local function updateItemProperties(tool)
  54.     if tool:IsA("Tool") and tool.Name == "HK500" then
  55.         -- GUNSCRIPT CHECK!!
  56.         local gunScript = tool:FindFirstChild("GunScript")
  57.         if gunScript and gunScript:IsA("LocalScript") then
  58.             -- VIEWMODELOFFSET HANDLING
  59.             local viewModelOffset = tool:FindFirstChild("ViewModelOffset")
  60.             if viewModelOffset and viewModelOffset:IsA("Vector3Value") then
  61.                 -- MAKE SURE VIMWODELOFFSET STAYS AT 0,0,0V VECTOR
  62.                 viewModelOffset.Changed:Connect(function()
  63.                     if viewModelOffset.Value ~= Vector3.new(0, 0, 0) then
  64.                         viewModelOffset.Value = Vector3.new(0, 0, 0)
  65.                         print("ViewModelOffset reset for HK500")
  66.                     end
  67.                 end)
  68.                 if viewModelOffset.Value ~= Vector3.new(0, 0, 0) then
  69.                     viewModelOffset.Value = Vector3.new(0, 0, 0)
  70.                     print("ViewModelOffset initially set for HK500")
  71.                 end
  72.             else
  73.                 warn("ViewModelOffset system not found or invalid on tool:", tool.Name)
  74.             end
  75.  
  76.             -- HANDLE WTHE WEIGHT
  77.             local weight = tool:FindFirstChild("Weight")
  78.             if weight and weight:IsA("NumberValue") then
  79.                 -- WEIGHT STAY AT 0
  80.                 weight.Changed:Connect(function()
  81.                     if weight.Value ~= 0 then
  82.                         weight.Value = 0
  83.                         print("Weight reset for HK500")
  84.                     end
  85.                 end)
  86.                 if weight.Value ~= 0 then
  87.                     weight.Value = 0
  88.                     print("Weight initially set for HK500")
  89.                 end
  90.             else
  91.                 warn("Weight system not found or invalid on tool:", tool.Name)
  92.             end
  93.         else
  94.             warn("GunScript not found or invalid on tool:", tool.Name)
  95.         end
  96.     end
  97. end
  98.  
  99. -- UPDAT LASOR COLOR those typos are NOT INTENTIONAL. I'M RUSHING THISS
  100. local function updateLaserColor(tool)
  101.     if tool:FindFirstChild("AttachmentFolder") then
  102.         local attachmentFolder = tool.AttachmentFolder
  103.         local redLaser = attachmentFolder:FindFirstChild("Red Laser")
  104.        
  105.         if redLaser and redLaser:FindFirstChild("Laser") then
  106.             local laser = redLaser.Laser
  107.             if laser:IsA("BasePart") then
  108.                 laser.BrickColor = BrickColor.new("Institutional white")
  109.                 laser.Color = Color3.new(248/255, 248/255, 248/255)
  110.                 print("Laser color updated to white for", tool.Name)
  111.             end
  112.         end
  113.     end
  114. end
  115.  
  116. -- UPDATE TOOLSSSS
  117. local function processTool(tool)
  118.     renameAndUpdateTool(tool)
  119.     updateSounds(tool)
  120.     updateItemProperties(tool)
  121.     updateLaserColor(tool)
  122. end
  123.  
  124. -- MONITOR TOOLS BACKPACK N CHARACTER
  125. local function monitorTools()
  126.     local backpack = player:FindFirstChild("Backpack")
  127.     local character = player.Character or player.CharacterAdded:Wait()
  128.  
  129.     -- BAKPACK
  130.     for _, tool in ipairs(backpack:GetChildren()) do
  131.         processTool(tool)
  132.     end
  133.  
  134.     -- EXISTING TOOLSCX
  135.     for _, tool in ipairs(character:GetChildren()) do
  136.         processTool(tool)
  137.     end
  138.  
  139.     -- MINITOR BACKPASKC TOOLS FOR
  140.     backpack.ChildAdded:Connect(function(tool)
  141.         task.wait(0.1) -- Wait for tool to fully load
  142.         processTool(tool)
  143.     end)
  144.  
  145.     -- MONITOR CHARACTER NEW TOL
  146.     character.ChildAdded:Connect(function(tool)
  147.         task.wait(0.1) -- Wait for tool to fully load
  148.         processTool(tool)
  149.     end)
  150. end
  151.  
  152. -- MONITORING REPAWN
  153. player.CharacterAdded:Connect(function(newCharacter)
  154.     monitorTools()
  155. end)
  156.  
  157. -- bro one j*b had
  158. monitorTools()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement