An infinite mag script
Posted: Thu Feb 15, 2024 9:25 pm
Any suggestions on how to improve this? I was thinking of making it purchaseable in world mode, but the price would double every time its purchased. The hardest part would be to make it double only for an individual player, requiring a database for how many times each player has bought the infinite mag.
Code: Select all
---@type Plugin
local plugin = ...
plugin.name = 'Infmag'
plugin.author = 'LOL'
plugin.description = 'The holy grail'
function minigun()
end
plugin.commands["/infmag"] = {
info = "practice mode",
canCall = function(ply) return ply.isAdmin end,
call = function(ply, man, args)
assert(man, "Not spawned in.")
local itm = items.create(itemTypes[3], man.pos, orientations.s)
if itm then
man:mountItem(itm,0)
itm.data.infMag = true
end
end,
}
plugin:addHook('Logic', function()
for _, itm in ipairs(items.getAll()) do
if itm.data.infMag then
itm.bullets = 255
end
end
end)