Hello, I'm having trouble running console commands for my gamemode, here is what im talking about:
gamemodes\laststand\gamemode\init.lua:25: '=' expected near 'player'-init
--player:concommand( "PlayerInitialGear" )
_______________
gamemodes\laststand\gamemode\cl_init.lua:21: 'then' expected near 'player'
-cl_init
--player:ConCommand( "sb_team1" )
________________
Any ideas on what I am doing wrong?/ Do you know any other ways i can run a console command?Thats solved. But heres another problem: It considers 'ready' invalid somehow and won't paint my vgui-function HumanBuy( ply )
ready = vgui.Create( "BFrame" )
ready:SetPos( ScrW() / 2, ScrH() / 2 ) //Set the position. Half the screen height and half the screen width. This will result in being bottom right of the middle of the screen.
ready:SetSize( 175, 175 ) //The size, in pixels of the Frame
ready:SetTitle( "Select Items/Upgrades" )
ready:SetVisible( true )
ready:SetDraggable( true )
ready:ShowCloseButton( true )
ready:MakePopup()
ready1 = vgui.Create( "BButtonSMG1", Ready ) // Define ready1 as a "DButton" with its parent the Ready frame we just created above.
ready1:SetPos( 20, 160 ) //Set position, relative to the frame (If you didn't parent it, it would be relative to the screen
ready1:SetSize( 140, 40 ) // How big it should be, again in pixels
ready1:SetText( "Buy SMG1-5" )
ready1.DoClick = function() //ready1.doclick = function, we just defined it as a function
ply:Give( "weapon_SMG1" )
Player:GiveAmmo(25,"smg1")
ply:SetNWInt("killcounter", ply:GetNWInt("killcounter") - 5)
end
ready2 = vgui.Create( "BButtonSMG1Ammo", Ready ) // Define ready1 as a "DButton" with its parent the Ready frame we just created above.
ready2:SetPos( 170, 160 ) //Set position, relative to the frame (If you didn't parent it, it would be relative to the screen
ready2:SetSize( 140, 40 ) // How big it should be, again in pixels
ready2:SetText( "Buy SMG1 Ammo-2" )
ready2.DoClick = function() //ready1.doclick = function, we just defined it as a function
Player:GiveAmmo(15,"smg1")
ply:SetNWInt("killcounter", ply:GetNWInt("killcounter") - 2)
end
ready3 = vgui.Create( "BButtonShotgun", Ready ) // Define ready1 as a "DButton" with its parent the Ready frame we just created above.
ready3:SetPos( 20, 120 ) //Set position, relative to the frame (If you didn't parent it, it would be relative to the screen
ready3:SetSize( 140, 40 ) // How big it should be, again in pixels
ready3:SetText( "Buy Shotgun-10" )
ready3.DoClick = function() //ready1.doclick = function, we just defined it as a function
ply:Give( "weapon_Shotgun" )
Player:GiveAmmo(10,"buckshot")
ply:SetNWInt("killcounter", ply:GetNWInt("killcounter") - 10)
end
ready4 = vgui.Create( "BButtonShotgunAmmo", Ready ) // Define ready1 as a "DButton" with its parent the Ready frame we just created above.
ready4:SetPos( 170, 120 ) //Set position, relative to the frame (If you didn't parent it, it would be relative to the screen
ready4:SetSize( 140, 40 ) // How big it should be, again in pixels
ready4:SetText( "Buy Shotgun Ammo-4" )
ready4.DoClick = function() //ready1.doclick = function, we just defined it as a function
Player:GiveAmmo(8,"buckshot")
ply:SetNWInt("killcounter", ply:GetNWInt("killcounter") - 4)
end
end
Then theres my last post aswell. But im extremely close to finishing my gamemode (first).