• Attempt at making a CSGO Knife Trading System: Failed
    14 replies, posted
111111111111111111111111
[CODE]keys++[/CODE] What is this meant to do? That doesn't add 1 to the total amount of keys if that's what you were thinking, it doesn't do anything in Lua. Also, try moving your AddKey function above your KeyTimerFunc, local functions usually screw up a bit if they're created after a function referencing them Also, you never seem to have ran KeyTimerFunc Also, this thing here: [CODE] Key.Timer.Timertime = 0 [/CODE] Doesn't work because you never created a variable called Keys Also, with this: [CODE] function ENT:SetupDataTables() self:NetworkVar( "String", 1, "keys") self:NetworkVar( "String", 2, "WalletMax") end local steamid = Player:SteamID() local keys = self:GetKeys() [/CODE] You never specified Ent or Player and you never made a function called GetKeys Also, this: [CODE] hook.Add( "HUDPaint", "HelloThere", function() draw.DrawText( keys.."Keys", "TargetID", 0, 0, Color( 255, 255, 255, 255 ), TEXT_ALIGN_CENTER ) end ) [/CODE] Should be in cl_init.lua, because HUDPaint is a clientside only hook Also, this: [CODE] if ply.DarkRPVars.AFK then KeyTimer.Timertime = 0 else KeyTimer.Timertime = 216000 end [/CODE] Wouldn't work because you never specified ply, and you never created a variable called KeyTimer (I know you created a timer called KeyTimer, but timers aren't automatically set as variables) Also, this: [CODE] hook.Add( "HUDPaint", "HelloThere", function() draw.DrawText( keys.."Keys", "TargetID", 0, 0, Color( 255, 255, 255, 255 ), TEXT_ALIGN_CENTER ) end ) [/CODE] Probably won't work because although you set a keys variable in your shared file, it was local, so I'm not sure if it'd get transferred or not [editline]15th July 2016[/editline] So yeah, there's a few problems with your code
[QUOTE=MPan1;50712674][CODE]keys++[/CODE][/QUOTE] adds 1 to keys
[QUOTE=lilas0426;50712709]adds 1 to keys[/QUOTE] That doesn't work in Lua.
[QUOTE=MPan1;50712715]That doesn't work in Lua.[/QUOTE] how would I make it add one key everytime the timer goes off?
[code]keys = keys + 1[/code]
111111111111111
For both of the "ENT" being a nil value errors you are getting, this is because ENT isn't defined. It should be replaced with a player object - as I believe that what you're trying to accomplish is to check the players keys and wallet maximum. The other error you are getting is simply because you need to provide a string instead of pure text as it thinks it is a variable - just wrap KeyTimer with quotation/speech marks - '/".
11111111111111111
[QUOTE=obesewhale;50714685] NOTE: Once this system is complete, please don't steal my code ._.[/QUOTE] All the code you have was spoon fed to you from facepunch, it's not your code.
[QUOTE=The Noodler;50714857]All the code you have was spoon fed to you from facepunch, it's not your code.[/QUOTE] none of it was copy-paste, I wrote it myself, people only told me how to change it, not give me something to replace it with.
[QUOTE=obesewhale;50714685] NOTE: Once this system is complete, please don't steal my code ._.[/QUOTE][/QUOTE] I don't think anyone would want to 'steal' your code anyways, lmao.
[QUOTE=Invule;50714878][/QUOTE] I don't think anyone would want to 'steal' your code anyways, lmao.[/QUOTE] I meant don't steal the idea or concept
stole it thanks
[QUOTE=Wingz;50714897]stole it thanks[/QUOTE] k.
Sorry, you need to Log In to post a reply to this thread.