Discord
Steam
/
Garry's Mod
/
Developers
/
My frame doesn..
Login/Join
Event Log
My frame doesn't show up and my gamemode won't work!
1 replies, posted
Search
In This Thread
[lua] include( "shared.lua" ) function set_team() frame = vgui.Create( "DFrame" ) frame:SetPos( 100, ScrH() / 2 ) frame:SetSize( 300, 300 ) //Set the size frame:SetTitle( "Choose Team" ) frame:SetVisible( true ) frame:SetDraggable( false ) frame:ShowCloseButton( false ) frame:MakePopup() team_1 = vgui.Create( "DButton", frame ) team_1:SetPos( 30, 30 ) team_1:SetSize( 100, 50 ) team_1:SetText( "Rebels" ) team_1.DoClick = function() frame:Close ( true ) RunConsoleCommand( "team_1" ) end team_2 = vgui.Create( "DButton", frame ) team_2:SetPos( 30, 130 ) team_2:SetSize( 100, 50 ) team_2:SetText( "Metro Cops" ) team_2.DoClick = function() frame:Close ( true ) RunConsoleCommand( "team_2" ) end team_3 = vgui.Create( "DButton", frame ) team_3:SetPos( 135, 30 ) //Place it next to our previous one team_3:SetSize( 100, 50 ) team_3:SetText( "Medic" ) team_3.DoClick = function() frame:Close( true ) RunConsoleCommand( "sv_cheats 1;thirdperson" ) RunConsoleCommand( "team_3" ) end team_4 = vgui.Create( "DButton", frame ) team_4:SetPos( 135, 130 ) //Place it next to our previous one team_4:SetSize( 100, 50 ) team_4:SetText( "Metro Cops medic" ) team_4.DoClick = function() frame:Close( true ) RunConsoleCommand( "sv_cheats 1;thirdperson" ) RunConsoleCommand( "team_4" ) end end concommand.Add( "team_menu", set_team ) function set_view() frame = vgui.Create( "DFrame" ) frame:SetPos( 1, 1 ) frame:SetSize( 800, 50 ) frame:SetVisible( true ) frame:SetDraggable( false ) frame:ShowCloseButton( false ) frame:MakePopup() third_person = vgui.Create( "DButton", frame ) third_person:SetPos( 5, 5 ) third_person:SetSize( 150, 40 ) third_person:SetText( "Third Person" ) third_person.DoClick = function() RunConsoleCommand( "sv_cheats 1;thirdperson" ) end firstperson = vgui.Create( "DButton", frame ) firstperson:SetPos( 806, 1 ) firstperson:SetSize( 500, 50 ) firstperson:SetText( "First Person" ) firstperson:DoClick = function() RunConsoleCommand( "firstperson" ) end concommand.Add( "set_view", set_view ) [/lua] When i run my gamemode, it says that it can't load, and neither of the frames show up. I have no idea what the problem is. It says there's a problem at line 89, which is the function thing and to be honest, i don't know what the function is supposed to do... Please help, avwos.
firstperson.DoClick = function() on line 89. Swap the : for a .
Sorry, you need to
Log In
to post a reply to this thread.