function wait_for_action()
gg.setVisible(false) 
while true do
gg.toast("Script made by HorridModz. Contact me on discord: User123456789#6424.")
gg.sleep(300)
if gg.isVisible()then
break
end
end
end

function choosemode()
-- mode = gg.choice({"Mode 1","Mode 2"},nil,"Choose the mode you would like to use. If a weapon is not working, switching modes may help. Mode 2 is recommended because it is much more accurate. Note that you will have to restart the game to try again with a different mode.")
mode = 3
end

function idfinder()
gg.alert("ID finder is coming soon! Follow HorridModz on gameguardian.net if you want to be notified when it comes out.")
end

function unlockone()
choosemode()
success = 0
unlock(weaponlist[i - 5])
if success == 1 then
gg.alert("Check the armory! If a weapon is glitched, does not have a buy button, or is not at your level, you can turn wifi off, wait for the wifi timeout, turn back on, and reconnect. If a weapon still does not have a buy button or is glitched, you cannot buy it. If you want to add another weapon, run the script again.")
end
end

function unlockall()
choosemode()
number = gg.prompt({'How many weapons to unlock? The more weapons, the longer it takes. Unlocking all weapons takes about 10 - 50 minutes, depending on your device. [1; 536]'}, nil,
{'number'})
count = tonumber(number[1])
i = 0
while i < count do
i = i + 1
unlock(weaponlist[i],0)
end
gg.alert("Check the armory! If a weapon is glitched, does not have a buy button, or is not at your level, you can turn wifi off, wait for the wifi timeout, turn back on, and reconnect. If a weapon still does not have a buy button or is glitched, you cannot buy it. If you want to add another weapon, run the script again.")
end

function unlockid()
wep = gg.prompt({"Type in the weapon id (contact User123456789#6424 for help finding ids if you do not know how)"},
{[1]='1078001003'},
{[1]='text'})
choosemode()
success = 0
unlock(wep[1],1)
if success == 1 then
gg.alert("Check the armory! If a weapon is glitched, does not have a buy button, or is not at your level, you can turn wifi off, wait For the wifi timeout, turn back on, and reconnect. If a weapon still does not have a buy button or is glitched, you cannot buy it. If you want to add another weapon, run the script again.")
end
end

function contactme()
gg.alert("Script made by HorridModz (User123456789#6424). The weapon IDS were found by me, G_M#5963, as well as some other people who did not credit themselves in their id lists.")
end


function tipsandtricks()
gg.alert("You must use android 7 and game version 22.4.3 or higher | To find your own ids, you can use the built-in id finder | Turn off wifi, wait for wifi timeout, turn wifi back on, and reconnect to make guns unlocked at your level and fix glitched weapons | If you cannot buy a gun you want, try restarting the game and running the script again | In version 22.3.6, the devs unpatched this hack - buy button is now back for all guns | Be careful when buying / using veteran guns or rare guns like desert fighter")
end

function unlock(id,alert)
edit = 1
if id == nil then
success = 0
edit = 0
end
gg.setVisible(false)
gg.setRanges(gg.REGION_ANONYMOUS)
gg.clearResults()
gg.searchNumber(id, gg.TYPE_DWORD)
success = 1
if alert == 1 then
if gg.getResultsCount() == 0 then
success = 0
gg.alert('Invalid ID, or gun has already been unlocked!')
edit = 0
end
if gg.getResultsCount() > 14 then
success = 0
gg.alert('Incompatible device or bad id! This is a TRAP VALUE! Editing it may cause a ban!!')
edit = 0
end
if gg.getResultsCount() == 1 then
success = 0
gg.alert('Bad id or incompatible device. You need android 7!')
edit = 0
end
end
if gg.getResultsCount() > 14 then
success = 0
edit = 0
end
if edit == 1 then
if mode == 1 then
if gg.getResultsCount() > 9 then
gg.getResults(gg.getResultsCount() - 3)
else
if gg.getResultsCount() == 9 then
gg.getResults(gg.getResultsCount() - 4)
else
if gg.getResultsCount() > 7 then
gg.getResults(gg.getResultsCount() - 3)
else
gg.getResults(gg.getResultsCount() - 4)
end
end
end
end
if mode == 2 then
if gg.getResultsCount() > 9 then
gg.getResults(gg.getResultsCount() - 4)
else
if ((gg.getResultsCount() == 9) or (gg.getResults == 8)) then
gg.getResults(gg.getResultsCount() - 3)
else
if gg.getResultsCount() == 7 then
gg.getResults(gg.getResultsCount() - 3)
else
gg.getResults(gg.getResultsCount() - 4)
end
end
end
end
if mode == 3 then
if ((gg.getResultsCount() == 7) or (gg.getResultsCount() > 9)) then
gg.getResults(gg.getResultsCount() - 3)
else
gg.getResults(gg.getResultsCount() - 4)
end
end
gg.editAll('1',gg.TYPE_DWORD)
end
gg.clearResults()
end


function spoofmenu()
gg.setVisible(false)
weaponlist = {"472637007","34556346","1698527272","577102974","1564303663","012067784116","1756261779","765762320","1916083476","1160191517","1007452085","1714256498","1844632159","291075282","1562803458","1899251928","1811439036","223648111","1523478334","250064900","571744669","1896556212","1503524410","1131520224","805071078","470530026","1712357346","1906873549","1429954965","1042008444","1898257649","1078819380","139759676","406715892","1163065246","190642895","1849091780","1613947306","665856323","1955787330","715361297","104297356","1413235781","471271187","393104511","623622656","921919177","1608794896","1162738674","286608289","065691940","056784","177168788","1660770758","1871332235","1667082967","1206847580","1640838584","1264043633","813507040","1320784480","2126395579","2112617871","1607990068","398811077","552484848","1895099977","889495138","3000770114717","711241763","206227950","553561803","1020224239","1992917663","1431223264","914666066","2134879584","1314965731","1375275163","1882136267","1776753008","1884075282","961779029","1060440780","1988422935","1271974349","618677551","187504014","1097806850","713024579","213052875","544547285","805071078","32620151","348020917","1979690239","1327246294","150566386","391682745","1564817388","472637007","781330870","359436545","744831271","138400878","341072236","641293355","532478468","1674620181","700087275","811119823","1185575729","1709205037","781803821","1130509566","138565963","902132807","580502718","546597520","31654116","1083919030","41135549","1967707459","1078001003","5531274","192768265","1798307844","405384158","850633462","880236287","1376339540","932249107","1775278995","1417065539","471393840","1727484562","356340244","408908554","1226462890","1721774935","1162738674","228886952","1064416293129493033","170014712880152300","849572103","203536178","909324455","635528739","577102974","29204108","578956887","180735068","1503393330495407929","2115518545","1257159725","315691453","877056784","2065691940286608289","818284366","1431549381","1337830922","296772685","491524056","118718489","1468547132","1896935093","2123554898","1165825924","1463544293","844350298","1014841617","1770258054","318674700","1699529325","1282220302","1826124797","839648793","1249394630","1275447765","78523691","1305602412","1648950633","2049860071","1664852412","1324526763","1711365592","2019396363","1612303531","434199056","1169284415","2083193943","825454492","03183399908205192019697","01784980529","02399932562","04125669368706598448124","1270555067","1958162166","474848773","364418818","732798751","1834527503","1267762384","1094021890","174739482","1566846984","1708510998","1625149654","2031678368","631299932","1742127845","1731121108","2026176168","2136161958","422122696","376149613","321550882","598277010","828147793","1215923123","1466216308","549003567","2138974223","419463271","946123693","584460721","1965913964","1277104364","791269051","1448711459","1232982751","1905642407","1017646527","2141940570","1594909746","85607916","178112823","67251563","286566896","1227613380","31431556","30607044","1346640545","2059652530","1810641408","1989769732","854789953","270670082","575476779","567998426","1283189570","1233990748","87113165","27371566","1326608792419095249","1504585261","1938266442","347404901","338403789","1343611220","1731678912","1877972903","561816047","438788276","1198897750","1552711825","837715681","87288348","910237886","887335593","2066275265","2077560162","910736709","737253316","617899874","2070592994","1801828058","1687773979","25619411","341635391","1608559084","1651304239","1200164112","111556064","1345479952","470530026","1712357346","716331765","1890803592","1131706052","643647699","365859340","25336295","1661181449","305427282","2032561829","1177529341","1811439036","12135407","1280880096","142660144","769064936","1828558225","1175658001","571744669","1172479598","381676005","1343755856","1503524410","478708353","489989899","236446668","1160191517","178119549","1138746203","223648111","1735206060","1899979731","291075282","2144657003","1849091780","1120295942","1061614437","147776484","765762320","1436342154","1203775435","1564652861","260428781","1078819380","907844317","445906780","495407929","2009213779","1331441564","1628825734","1482403805","1671760128","1471663537","1337136250","741748000","925961603","1556772545","161002262","1661556820","160787252","1386088620","1363369471","1987523983","797582963","1301548174","945778742","1090082601","1607162392","1580297219","1528363128","1508204331","7657623201756261779","1160200985","2094586064","1274841834296679079","1465721754","631059274","2144754745","1521154832","525577882","843273993","353875038","1347359359","531581330","941237828","1238175353","2050803115","685348835","1595463359","634759090","516627498","842494181","1855838559","715893600","1562803458","1527679039","2018713198","368760808","1552054791","1928759918","1326044590","1413574182","716020953","2021606821","2089077445","556133772","226549854","192853699","1800008951","410610785","863392747","1657734870","1335353522","1450740466","347810221","1639266271","1625648411","1943131553","2060462991","133779209","167949038","944448309","1586196613","492019975","1200099065","1682463899","1540150607","1964117948","102010226","2032407540","1040877358","958600885","1874185457","1005092095","1522670775","1318097758","1504130469","1455524742","971141154","916962599","1256461366","736766551","776842865","1043050490","126371469","1906873549","1591543843","610280094","2042078499","1833999082","192019697","1326608792","869129695","129493033","1064416293","584460712","361942176","1938908991","117169819","1614911683","1974823506","2144337432","911373450","1426186750","237965769","1256693687","832145690","770114717","20849778","693501208","1330069359","1379987906","1382473","2019188935","2020729062","174622497","1258525371","441984440","1229573684","1685309455","1485663477","84574881","377434248","1244647403","184978574","225694780","1513342399","1756261779","1274841834","296679079","777336987","945301359","647239499","1797345602","1429954965","1371223402","1329849926","2118467187","1371796097","1507592096","1013072275","1751486255","1421619724","855850785","264489712","2116432073","1816233236","1122116926","77089832","729111596","1325239718","1825337655","1363209448","1776086294","1095634626","971883897","1007452085","1808001487","779574417","1986788520","307472056","1180924159","1309401412","1837355830","1905784464","223889505","755096241","309452774","1898890602","1659578818","857527756","9877704","79025229","1896631276","1171036533","27591365","502193192","1206744445","1938262789","1899251928","1364248464","1863825957","1959988946","1248246573","1419393306","990739517","15216374101546469397","34556346","1698527272","1564303663","012067784116","1916083476","1714256498","1844632159","1523478334","250064900","1896556212","1131520224"}
guns = {"Throwing Spears","Pulling Sucker Gun","storm of all seas","Chromakey VFX Camera","bubble gum","TNT thrower","aboard puncher","fist of fate","deadly tail","shell bubbler","tide bracers","winged revolver","call of sirens","disguised rifle","treasurer","minigun cyber module","thor hammer","evil rubiks cube","rednecks bazooka","rock smelter","plasmatic digger","flat rifle ","charles","super simple dimple","mysterios obelisk ","sacred cat will","sentinel","golden eagles","bomber slinger","Antidote Missile Launcher","Handy Darts","Full Moon Rifle","Moon Blades","Solar Lens","Automatic Injector","Makeshift Piercer","Eternal Light","Eco-rifle","Plague Spreader","Tricky Electricizer","Moon Hunter Bow","Heavy Elf Crossbow","Lightbringer","Supernova Generator","Blacklist Pistol","Swords Of Intelligence","Controlled Drone System","Deadly Beamer","Offensive Rocket System siege minigun -","2","877","818","ultimatum","knife and compass","Megahorn","atomic splitter","Dimerian divider","witch's sheep cauldron","nuclear refile","cyclops sling","advanced scout refile","hand minigun","propitiator","heavy sniper rifle","tactical knife (carambit)","spec ops pistol","irstrike laptop","stinger","semi auto shotgun","storm","instigator","overseer","pixel cola refresher","succubus","ten O'clock postman","runic hammer","arahna bite","medusa","bigb oven","mr. Mixer","cookie minigun","tomianom","system admin","nti virus","enchanted blades","alchemist staff","healing carp","hypersound uzi","war horse","sparkling horn","adventure swords","virtual connect ","mysterious obelisk","chipping whip","brutal thinner","plasitic rifle ","block flamethrower ","raccoon with pipe","soda+pop","artifact","throwing spear","offensive catapult ","amazon's sharp ring","wave pulser","fatality hook ","cooking totem ","water blades","dragon bite","dislike","likes absorber","bad comment","royal cobra spirit","eraser crossbow","sharp chaser","punishing light ","experimental rifle","tactical scorcher","thunder storm","terramorphing stone","Default Heavy","sleipnir","eye of the storm","fear and despair","activity neutraluzer","goo substance pistol","goo substance rifle ","spirit mask","enchanting altar","Super Fixer","Cheater Hunter","Bug Cleaner","Mammoth","Tactical Pistol","Large Caliber Machine Gun","Ranarok","Sun Eater","Deceitful Cheater","Cuning Flame","Geri Freki","Huginn","Offensive Rocket System","Manual Inferno","Headhunter Pistols","-Project Rapid Flock","Project Marlin","bomber cat","Laser cat rife","cyber cat laterne","Chromakey VFX","-Dance rifle","Rifle.me Online","Fate","Wayfarer ","unranium grenade launcher","corpuscular revolver","engineering saw thrower","disruptive howitzer","siege minigun","anti-aicraft module","jet spear","Scarab Shrine","Black Obelisk","Fair Judge","Plaguebringer","eternal suns wrath ","Piercing Gaze of RA","streaming beast","Hype Yo Yo","Ninja swordpad","BRO Rifle","Blot Cannon","Blot Shotgun","Blot Axe","Masterly Trumpet","Anvil Pistol","Sad Magnet ","Bro Steamer ","Pencil Spear","Ink Spreader","Tooth of Fate","Ritual Rifle","Staff of Crystals Will","Heavy SpikoSaur","Bone o Saur Sword","Aerosaur Rifle","Extracting Ray Pistol","Portal Rifle ","Winged Bow","Call of Valhalla","Frosty Fangs","Frozen Heart ","PGA","PGA","PGA","PGA","Solar Flare","Star Shard","Magnetic Storm","Good Code","Ban Hammer","VR Blasters","Bow Soul Card ","Lace Soul Card ","Sword Soul Card","Fire Spirit","Lives Harvester","Thermal Ultra Scythe","Project RedButton","Combat Overlords","Sentence","Jet Dragon","demonic crusher","Time Scythe","Ronin","Piercer","Borders Eraser","Final Verdict","Dual Beam","Brutal Rainbow","Foam Sword","Sand Tower Pistol","Waterman's Rifle","Magical Boomerang","High Pressure Rifle","Sharkado","Showe Sprinkler","Digital Drawing Pad","Gun Force PXG","Render Staion","Total Planer","Money Rain","Invigorating Awaker","Rude Bully","Laser Ninja","Rebel","Plasma Beast","Repressor","Maximum Cruetly","Debts Collector","Godfathers Assistant","Black Label","Plan B","Disturbed Sarcophagus","Pharaon III Breath","Zap Katana","Cyber Lantern","Saboteur","Incinerator","Traitor","Underwater Carbine","Echo Scaner","Submarine Drone Station","Goo Substance Scythe","Restructuner","Candy Revolver","Explosive Caramel","HO HO Rocket","Outlaw Catcher","Mobile Out Post","Fair Sheriff","C4 Basket","Head Of Statue","Tank Turret","Space Parasite Dreadnought","Space Parasite Fighter","Alien Parasite Mothership","Bad Clowm","Disturbing Balloons","Clown Chainsaw","Elven Killer Rifle","Assassin's Daggers","Farewell Volley","Otherworldly Wanderer","Dark Deer Bow","Reflected Santa Sword","Combat Fireplace","Combat Candy Machine","Gift Stealer","Tricky Gingerbread","End of Fairytale","Fairy's Poleaxe","Butterfly Eater","SpinnyShooty","WatchySnipy","PullyBlasty","Sacred Cat Will","Sentinel","Ritual Embalmer","Howl of the Mummy","Conductor of Souls ","Cerberus","ferocious poleaxe","System scorpion","Rumble","Deep Ambusher ","Treauser","Mutation Cannon","Thor Hammer","Sharp Snowflake","BLOQ Plasma Module","Offensive Fireworks","Summon Dagger","Explosive Lemonnade","Thunderbolt","Plasmatic Digger","Secret Burger Factory","Cthulhu Legacy","drilling railgun","Charles","Deadly Flower","Mayor's Trophy Revoler","Pixel Cola Cans","Shell Bubbler","Prophet Staff","NOOB Rifle","Evil Rubik's Cube","Ectoplasmic Grenade Launcher","Bubble Slasher","Disguised Rifle","Mutagen Neutralizer","Eternal Light","Mirroer","Like Bootster","Killer Chord","Deadly Tail","Carrot Crossbow","Drone Combat Station","Combat Darts","Werewolf Paws","Full Moon Rifle","Fireflies Blessing","ranch of Wisdom","180.735.068","Irraditated SMG","Mutant Fish","Spiky Limbs","Ultrasonic Rifle","Electronics Burner","Hounds RX03","Anubis","Cloud Launcher","Witch Doctor","Transformed Blaster","Ouroboros","Scouter's Rifle","Sparkling Hydra","Battle Rook","Checkmate","Aspen Spear","Dual Hunter Crossbows","Hot Greetings","Hard Corn","Fan's Revolver","Penilizer","Asteriod","Venus & Mercury","Saturn","Aboard Puncher","Fist of Fate","Dragon Energy Emmiter","Alien Shovel","torpedo launcher lol","AI Pistol","Super Drill","Meteorite Destroyer","River Dragon","Sharp Fans","Spirit Staff","adamant claws","Space Shovel ","Heroic Shovel","Protector of Peace","Supa Expedition Tool","Pnuematic Needle Rifle","Crossbow","Evil Pig Hammer","Lava Flail","Heart of Volcano","Cactus Shovel","Rune Stone ","Bone Knife ","Flaming Skull","Reversed Pistol","Law Enforcer","Ice King's Fury","Frozen Lich Bow","Agent Valentine","Lovebirds","Heartbreakers","Ice Paws","Sparkly Blaster","Scythe","Flaming volcano","Firestarter","Invader","Core Sword","Hedgehog","Undertaker","Astral Bow","Little Cthulhu","Wyvern","Sakura","Manga Gun","Anime Scythe","Monster Blaster","Devastator","Good and Evil","Steam Gun","Alien Shuriken Thrower","Ice Generator","Ice Cream Pistol","Desert Eagle","Alligator","Tiger","Lazer Bow","Toy Bomber","Ghost Lantern","Demoman","Photon Sniper Rifle","Double Dragon","Happy Tree slayer","Tactical Tomahawk","Executioner","Serious Arguement","Celebrational Bazooka","Meteor Shower","Proton Freezer","Werewolf","Batohawk","Spider Sense","Combat Gauntlet","Golden Eagles","Cyber Revolver","Default Shotgun","Combat Knife","pga05 slender touch","pga01 living rifle","combat candy","supply airdrop","headhunter pistols","harsh punisher","solar flare","pew blaster ","cryolator","freon","yeti spirit"," new year defender","candy axe ","notik","iron sword","desert fighter","pga06tv","gifted revolvers","semi auto shotgun","ice club","heroic epee","BIG DATA ","Network Streamer ","Disconnector","Flash Drive","Duck Hunter","Disc Battle Station","Hyper Mega Cannon","Supershot Rifle","Pew Pew Rifle"," Tube Backpack","Pixel Stream Sword","healing staff","portal cannon","Aphrodite Crossbow -","Earth Spike Spell","Battle Falcon","social uzi        ","Aboard Puncher","Plasma minigun","Alien Shovel","Comet","med surgery module","fidget thrower","void ray rifle","bomber slinger","One shot","masterpiece musket","Heavy Shocker","X-mas destroyer","Electric Arc","Santa Sword","Heavy Gifter","Dracula","Pencil Thrower","Ruler Sword","Infiltrator","Golden friend","Candy Baton","Portable Death Moon","Dual Revolvers","Photon Shotgun","Laser disc thrower","Electromagnetic Cannon","Charge Cannon","Dual Shotguns","Storm Hammer","Tide Bracers","Shrimposaur","Ancestors Curse","Temple Claws","Fake Pistol","Hocup Pocus","Mutant Slayer","Swat Rifle","Hockey Stick","Laser Minigun","Eliminator X2","Electric Vortex","Neon Fighter","Warmaster","Particle Accelerator","curse spell ","airblade spell","shadow spell","automatic decorator","mithril rifle","Champion Peacemaker","Storm Poleaxes","Mystic Potion","Minigun Cyber Module","Poison Spell","Dual Cyro Pistols","Laser Assistant","Christmas Ultimatum","Black Mamba","Bone Sniper Rifle","Gift Stitcher","Pulling Sucker Gun","storm of all seas","bubble gum","TNT thrower","deadly tail","winged revolver","call of sirens","rednecks bazooka","rock smelter","flat rifle ","super simple dimple"}
options = {"Cancel", "Unlock All (takes around 10 - 50 minutes","Put in my own id","Contact me","Tips and tricks","New: ID Finder"}
i = 0
while i < #guns do
i = i + 1
options[#options + 1] = guns[i]
end
menu = gg.multiChoice(options,nil,"Gun to unlock (You need android 7 and game version 22.4.3 or higher for this to work!)")
if menu == nil then
gg.setVisible(false)
os.exit()
end
if menu[1] then
gg.setVisible(false)
os.exit()
end
if menu[2] then
unlockall()
end
if menu[3] then
unlockid()
end
if menu[4] then
contactme()
end
if menu[5] then
tipsandtricks()
end
if menu[6] then
idfinder()
end
i = 0
while not menu[i] do
i = i + 1
end
if i > 6 then
unlockone()
end
end

gg.alert("Welcome to PG3D weapon unlocker 5.0 by HorridModz (User123456789#6424)! You need android 7 for this to work! I am sorry for such a long wait - when the script was patched in 22.4.3, I had to figure out how to make it work again. I also added more guns!")
gg.alert("This script is ONLY for version 22.4.3 and higher. Use weapon unlocker 4.3 (you can find it on gameguardian.net) for 22.4.2 and lower. Note: If a gun you want is not working, restart the game and try again.")
spoofmenu()
while true do
wait_for_action()
os.exit()
end



 

Lua online compiler

Write, Run & Share Lua code online using OneCompiler's Lua online compiler for free. It's one of the robust, feature-rich online compilers for Lua language, running the latest Lua version 5.4. Getting started with the OneCompiler's Lua editor is easy and fast. The editor shows sample boilerplate code when you choose language as Lua and start coding.

Taking inputs (stdin)

OneCompiler's Lua online editor supports stdin and users can give inputs to programs using the STDIN textbox under the I/O tab. Following is a sample Lua program which takes name as input and prints hello message with your name.

name = io.read("*a")
print ("Hello ", name)

About Lua

Lua is a light weight embeddable scripting language which is built on top of C. It is used in almost all kind of applications like games, web applications, mobile applications, image processing etc. It's a very powerful, fast, easy to learn, open-source scripting language.

Syntax help

Variables

  • By default all the variables declared are global variables
  • If the variables are explicitly mentioned as local then they are local variables.
  • Lua is a dynamically typed language and hence only the values will have types not the variables.

Examples

-- global variables
a = 10

-- local variables

local x = 30
Value TypeDescription
numberRepresents numbers
stringRepresents text
nilDifferentiates values whether it has data or not
booleanValue can be either true or false
functionRepresents a sub-routine
userdataRepresents arbitary C data
threadRepresents independent threads of execution.
tableCan hold any value except nil

Loops

1. While:

While is also used to iterate a set of statements based on a condition. Usually while is preferred when number of iterations are not known in advance.

while(condition)
do
--code
end

2. Repeat-Until:

Repeat-Until is also used to iterate a set of statements based on a condition. It is very similar to Do-While, it is mostly used when you need to execute the statements atleast once.

repeat
   --code
until( condition )

3. For:

For loop is used to iterate a set of statements based on a condition.

for init,max/min value, increment
do
   --code
end

Functions

Function is a sub-routine which contains set of statements. Usually functions are written when multiple calls are required to same set of statements which increase re-usuability and modularity.

optional_function_scope function function_name( argument1, argument2, argument3........, argumentn)
--code
return params with comma seperated
end