• Help with Weapon Shop
    1 replies, posted
I'm currently creating a boring little gamemode as a kickstarter to get my brain back into Lua (Haven't coded in a while). I'm making a Deathmatch survival type gamemode that involves many custom guns I have created. I have a money system (kills steal money from other players). I have a test shop binded to F1 but I can't remember how to properly code If statements. Here's what I got: [CODE] local button = vgui.Create( "DButton", frame ) button:SetPos( 10, 40 ) button:SetSize( 200, 45 ) button:SetText( "Buy Scrap Pistol" ) button.DoClick = function() if LocalPlayer():GetNWInt( "cash" ) => ( 100 ) then ply:Give( "weapon_scrappistol" ) else return false end end usermessage.Hook( "scrapshop", scrapshop )[/CODE] Here's the error I get: [B][ERROR] gamemodes/rogue/gamemode/cl_init.lua:53: 'then' expected near '=' 1. unknown - gamemodes/rogue/gamemode/cl_init.lua:0 Couldn't Load Init Script: 'rogue/gamemode/cl_init.lua' [BoneZ|13|STEAM_0:0:56070072] Lua Error: [ERROR] gamemodes/rogue/gamemode/cl_init.lua:53: 'then' expected near '=' 1. unknown - gamemodes/rogue/gamemode/cl_init.lua:0 [BoneZ|13|STEAM_0:0:56070072] Lua Error: Couldn't Load Init Script: 'rogue/gamemode/cl_init.lua'[/B] Any help would be appreciated, thanks in advance.
You should have posted this thread here: [URL="https://facepunch.com/forumdisplay.php?f=65"]https://facepunch.com/forumdisplay.php?f=65[/URL]
Sorry, you need to Log In to post a reply to this thread.