0% found this document useful (0 votes)
30 views3 pages

Message - 2025-05-21T173849.945

The script is designed to modify weapon properties in a game, enabling features like infinite ammo and adjustable fire delay. It identifies remote events and functions related to weapon actions, updates ammo values, and manages tool data when tools are added or removed from the player's character. Additionally, it ensures these settings persist during gameplay and cleans up connections when the game closes.

Uploaded by

ys45782
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views3 pages

Message - 2025-05-21T173849.945

The script is designed to modify weapon properties in a game, enabling features like infinite ammo and adjustable fire delay. It identifies remote events and functions related to weapon actions, updates ammo values, and manages tool data when tools are added or removed from the player's character. Additionally, it ensures these settings persist during gameplay and cleans up connections when the game closes.

Uploaded by

ys45782
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 3

local settings = {

enabled = true,
fire_delay = 0.001,
infinite_ammo = true,
ammo_value = 99999
}

local Players = game:GetService("Players")


local RunService = game:GetService("RunService")
local player = Players.LocalPlayer

local remotes = {}
for _, obj in ipairs(game:GetDescendants()) do
if (obj:IsA("RemoteEvent") or obj:IsA("RemoteFunction")) and
(obj.Name:lower():match("fire") or obj.Name:lower():match("shoot") or
obj.Name:lower():match("ammo") or obj.Name:lower():match("weapon")) then
table.insert(remotes, obj)
print("Remote:", obj:GetFullName())
end
end

local function findAmmo(tool)


if not tool then return end
local paths = {"Ammo", "GunStates.Ammo", "Stats.Ammo", "Settings.Ammo",
"Bullets", "CurrentAmmo", "Magazine", "Clip"}
for _, path in ipairs(paths) do
local value = tool:FindFirstChild(path, true)
if value and (value:IsA("NumberValue") or value:IsA("IntValue")) then
return value end
end
end

local function findMaxAmmo(tool)


if not tool then return end
local paths = {"MaxAmmo", "GunStates.MaxAmmo", "Stats.MaxAmmo",
"Settings.MaxAmmo", "MaxBullets", "ClipSize", "MaxClip"}
for _, path in ipairs(paths) do
local value = tool:FindFirstChild(path, true)
if value and (value:IsA("NumberValue") or value:IsA("IntValue")) then
return value end
end
end

local function updateServerAmmo(tool)


if not settings.infinite_ammo then return end
for _, remote in ipairs(remotes) do
pcall(function()
if remote:IsA("RemoteEvent") then
remote:FireServer(settings.ammo_value, tool)
elseif remote:IsA("RemoteFunction") then
remote:InvokeServer(settings.ammo_value, tool)
end
print("Sent", remote.Name, settings.ammo_value)
end)
end
end

local function updateGunData(tool)


local gunDataModule = tool:FindFirstChild("GunData")
if not (gunDataModule and gunDataModule:IsA("ModuleScript")) then return end
local gunData = require(gunDataModule)
if not gunData then return end
for k, v in pairs(gunData) do print(tool.Name, k, "=", v) end
local fire_props = {"cooldown", "fireRate", "cooldownTime", "delay",
"shotDelay", "rateOfFire", "slowdown_time"}
for _, prop in ipairs(fire_props) do
if gunData[prop] then
gunData[prop] = settings.fire_delay
print(tool.Name, prop, "->", settings.fire_delay)
end
end
if settings.infinite_ammo then
local ammo_props = {"ammo", "currentAmmo", "magazine", "maxAmmo",
"bullets"}
for _, prop in ipairs(ammo_props) do
if gunData[prop] then
gunData[prop] = settings.ammo_value
print(tool.Name, prop, "->", settings.ammo_value)
end
end
end
end

local function updateToolAmmo(tool)


if not settings.infinite_ammo then return end
local ammo = findAmmo(tool)
local maxAmmo = findMaxAmmo(tool)
if ammo then
ammo.Value = settings.ammo_value
print(tool.Name, "Ammo ->", settings.ammo_value)
updateServerAmmo(tool)
end
if maxAmmo then
maxAmmo.Value = settings.ammo_value
print(tool.Name, "MaxAmmo ->", settings.ammo_value)
end
end

local connections = {}
local function setupCharacter(char)
if not char then return end
local addConn = char.ChildAdded:Connect(function(child)
if child:IsA("Tool") then
updateGunData(child)
updateToolAmmo(child)
local ammo = findAmmo(child)
if ammo then
table.insert(connections, ammo.Changed:Connect(function()
if settings.infinite_ammo then
ammo.Value = settings.ammo_value
end
end))
end
end
end)
local removeConn = char.ChildRemoved:Connect(function(child)
if child:IsA("Tool") then
updateGunData(child)
updateToolAmmo(child)
end
end)
table.insert(connections, addConn)
table.insert(connections, removeConn)
end

table.insert(connections, player.CharacterAdded:Connect(function(char)
setupCharacter(char)
end))

if player.Character then
setupCharacter(player.Character)
end

local last_update = 0
table.insert(connections, RunService.Heartbeat:Connect(function()
if not settings.enabled or tick() - last_update < 0.1 then return end
pcall(function()
for _, tool in ipairs(player.Backpack:GetChildren()) do
if tool:IsA("Tool") then
updateGunData(tool)
updateToolAmmo(tool)
end
end
if player.Character then
for _, tool in ipairs(player.Character:GetChildren()) do
if tool:IsA("Tool") then
updateGunData(tool)
updateToolAmmo(tool)
end
end
end
end)
last_update = tick()
end))

game:BindToClose(function()
for _, conn in ipairs(connections) do
conn:Disconnect()
end
end)

You might also like