• Limitatations
    4 replies, posted
How would i make it so [code] function CombineRations() if( !LocalPlayer():IsCombineDefense() ) then CreateOkPanel( "Can't do this", "You need to be combine to be able to do this." ); return; end RationBox = CreateBPanel( "Rations", 10, 10, 220, 75 ) RationBox:AddLabel( "Drop a ration.", "NewChatFont", 90, 15 ) Model = vgui.Create( "DModelPanel", RationBox ); Model:SetPos( 5, 5 ); Model:SetSize( 64, 64 ); Model:SetModel( "models/weapons/w_package.mdl" ); Model:SetFOV( 8 ); Model:SetLookAt( Vector( -99, -23, -200 ) ); Model:SetCamPos( Vector( 84, 7, 150 ) ); Model.LayoutEntity = function( self ) end local function CreateRation() LocalPlayer():ConCommand( "rp_makeration" ) end RationBox:AddButton( "Drop Ration", 75, 45, function() CreateRation() end ) end [/code] This can't be spammed?
So that the button can't be spammed? This is a bit unclear. Were that so, however, you would set up a variable on initialization of the script, for example, [lua]local NextPress = 0[/lua] Every time they pressed the button, you would set NextPress to [lua]RealTime() + YOURLENGTHINSECONDSHERE[/lua] given, of course, that [lua]NextPress <= RealTime()[/lua] This would limit them to pressing the button every YOURLENGTHINSECONDSHERE, so... Yeah.
Mind posting that into the code? That's my main challenge in LUA...placement. :mad:
So basicly you want to be a good ripper but your failing so you want him to place it in your code so ripping is easyer
:smug: Yes, no..i CAN code. it's jsut when people give me snippets i fuck them up. T.T
Sorry, you need to Log In to post a reply to this thread.