Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local ReplicatedStorage = cloneref(game:GetService("ReplicatedStorage"))
- local Players = cloneref(game:GetService("Players"))
- local LocalPlayer = Players.LocalPlayer
- local WeaponController = require(ReplicatedStorage.common.ZS_Framework.Modules.Controllers.WeaponController)
- local PromptModule = require(ReplicatedStorage.common.ProximityPromptZS)
- local PromptTable = nil
- local Upvalues = debug.getupvalues(PromptModule.GetPromptByIdentifier)
- for Index = 1, #Upvalues do
- local Value = Upvalues[Index]
- if type(Value) == "table" and next(Value) then
- local _, FirstEntry = next(Value)
- if type(FirstEntry) == "table" and FirstEntry.Triggered then
- PromptTable = Value
- break
- end
- end
- end
- local StringUpper = string.upper
- local StringFind = string.find
- local GetCurrentWeapon = WeaponController.GetCurrentWeapon
- task.spawn(function()
- while task.wait(0.5) do
- local CurrentWeapon = GetCurrentWeapon(WeaponController)
- if CurrentWeapon and CurrentWeapon.Config and not CurrentWeapon.Config.IsMelee and CurrentWeapon.StoredAmmo == 0 then
- if PromptTable then
- for _, Prompt in pairs(PromptTable) do
- local Properties = Prompt.Properties
- if Properties and Properties.Enabled ~= false then
- local ActionText = Properties.ActionText
- if ActionText and StringFind(StringUpper(ActionText), "REFILL") then
- Prompt.Triggered:Fire(LocalPlayer)
- end
- end
- end
- end
- end
- end
- end)
- warn("AUTO REFILL AMMO LOADED")
Advertisement
Add Comment
Please, Sign In to add comment