Lua Autorun not autorunning?

i know i’m posting alot of questions… sorry.

Ok, i’m having another problem, when i put a code in autorun, it won’t… well, autorun.

heres the code:

[lua] local button1 = vgui.Create(“DButton”)
button1:SetText(“Kill Yourself!”)
button1.DoClick = function()

i don’t get it it’s supposed to autorun if it’s in the autorun foler.


It is meant to be run if you put it in the Autorun Folder. One way of telling if it has is to put this somewhere in the file and look in the console for it.
[lua]for i=1, 20 do
print(“Hooray the file was loaded in Autorun!”)
If you can’t find 20 lines of this then the file isn’t being autorun at all, in which case it’d help if you gave us a fill filepath for the file you’ve put in autorun, you wouldn’t believe how many times the problem has been people not putting it in the right place.

it’s where it should be.


actually, it did say “hooray the file was loaded in autorun” 20 times, but my button still isn’t there.


Am i asking too many questions at once, or is this just a stupid question?

Because your not telling the button when to MakePopup()

don’t you do that only with DFrames?

Nope, MakePopup() is for everything derma-related. What it basically does is enables your mouse cursor to press things and type in derma-related stuff, while still maintaining the ability to move around (if you’re not typing, that is).

ok,i did that, and it’s still broken.

the fucking button won’t appear.

all i want to do is make a BUTTON that kills me, and i don’t want to type in the console, at any time, to do it.

do computers really hate me THAT much!?

No one is going to help you until your rage meter stops increasing.

I find it’s always best to only show gui in a frame, that way you can actually get rid of it later without restarting.
[lua]local frame = vgui.Create(“DFrame”)
frame:SetTitle(“Suicide Button”)
frame:SetSize(100, 70)

local button1 = vgui.Create(“DButton”, frame)
button1:SetText(“Kill Yourself!”)
button1.DoClick = function()


This kid needs to quit raging. Here is the code I used when I first started messing with dermas…
function Playermenu()

DermaPanel1 = vgui.Create( “DFrame” )
DermaPanel1:SetPos( 50,25 )
DermaPanel1:SetSize( 500, 500 )
DermaPanel1:SetTitle( “Weapon Menu (Coded by Mat)” )
DermaPanel1:SetVisible( true )
DermaPanel1:SetDraggable( true )
DermaPanel1:ShowCloseButton( true )

local DermaButton1 = vgui.Create( "DButton", DermaPanel1 )
DermaButton1:SetText( "Super Shorty" )
DermaButton1:SetPos( 12.5, 30 )
DermaButton1:SetSize( 100, 25 )
DermaButton1.DoClick = function()
RunConsoleCommand("give", "weapon_supershorty")

local DermaButton2 = vgui.Create( "DButton", DermaPanel1 )
DermaButton2:SetText( "Baseball Bat" )
DermaButton2:SetPos( 125.5, 30 )
DermaButton2:SetSize( 100, 25 )
DermaButton2.DoClick = function()
RunConsoleCommand( "give", "weapon_bat" )

local DermaButton3 = vgui.Create( "DButton", DermaPanel1 )
DermaButton3:SetText( "AK-47" )
DermaButton3:SetPos( 235, 30 )
DermaButton3:SetSize( 100, 25 )
DermaButton3.DoClick = function()
RunConsoleCommand("give", "weapon_zpsak47")

local DermaButton4 = vgui.Create( "DButton", DermaPanel1 )
DermaButton4:SetText( "Glock 18C" )
DermaButton4:SetPos( 345, 30 )
DermaButton4:SetSize( 100, 25 )
DermaButton4.DoClick = function()
RunConsoleCommand("give", "weapon_zpsglock")

local DermaButton5 = vgui.Create( "DButton", DermaPanel1 )
DermaButton5:SetText( "Revolver" )
DermaButton5:SetPos( 12.5, 70 )
DermaButton5:SetSize( 100, 25 )
DermaButton5.DoClick = function()
RunConsoleCommand("give", "weapon_zpsrevolver")

local DermaButton6 = vgui.Create( "DButton", DermaPanel1 )
DermaButton6:SetText( "Desert Eagle" )
DermaButton6:SetPos( 130.5, 70 )
DermaButton6:SetSize( 100, 25 )
DermaButton6.DoClick = function()
RunConsoleCommand("give", "weapon_zpsdeagle")


function Hidemenu()
if DermaPanel1:IsVisible() == true then

concommand.Add(“matsmenu”, Playermenu)
concommand.Add("+matsmenu", Playermenu)
concommand.Add("-matsmenu", Hidemenu)
It was a singleplayer menu to give me the weapons for my gamemode, I was making a Left 4 Dead gamemode but I got stuck and stopped.