Derma Error

Here is the error::: autorun/client/cl_fnamemenu.lua:39: Tried to use invalid object (type Panel) (Object was NULL or not of the right type)autorun/client/cl_fnamemenu.lua:39: Tried to use invalid object (type Panel) (Object was NULL or not of the right type)

WHAT IS WRONG??

Here is the code::
[lua]
–[[
Purpose: Character creation
Base: Yourmuminacan
Derv: cidrp
–]]

– start us out with the base function

function FirstNameMenufunc()
FirstNameMenu = vgui.Create( “DFrame” )
FirstNameMenu:SetTitle( “Character full name” )
FirstNameMenu:SetSize( 160, 100 )
FirstNameMenu:Center( )
FirstNameMenu:SetDraggable( false )
FirstNameMenu:ShowCloseButton( false )
FirstNameMenu:MakePopup( )

– Add a instructions label.
local FirstNameLabel = vgui.Create( “DLabel”, FirstNameMenu )
FirstNameLabel:SetSize( 110,10 )
FirstNameLabel:SetPos( 0, 50 )
FirstNameLabel:SetText( "first and last name! " )
FirstNameLabel:SetTextColor( Color( 255, 0, 0, 255 ) )

– The first name entry.
local FirstNameTextEntry = vgui.Create( “DTextEntry”, FirstNameMenu )
FirstNameTextEntry:SetSize( 120,20 )
FirstNameTextEntry:SetPos( 0, 30 )
FirstNameTextEntry:SetText( “Forename Surname” )

– Draw a texture cover
local DermaImage = vgui.Create( “DImageButton”, FirstNameFrame )
DermaImage:SetPos( ScrW() / 2 - 400, ScrH() / 2 - 100 )
DermaImage:SetSize( 160, 100 )
DermaImage:SetImage( “decals/bloodstain_003.vtf” ) – Texture cover
DermaImage:SizeToContents()
DermaImage.DoClick = function()
end

– Add the next button to continue the character creation process.
local DermaButton = vgui.Create( “DButton”, FirstNameFrame )
DermaButton:SetText( “Next” )
DermaButton:SetPos( 600, 350 )
DermaButton:SetSize( 50, 25 )
DermaButton.DoClick = function ()
if ( FirstNameTextEntry:GetValue() == “” ) then
LocalPlayer():PrintChat( “CHARACTER NOTICE: First/last name missing!”, false )
else
LocalPlayer():ConCommand( "eng_setrpnick " … FirstNameTextEntry:GetValue() );
FirstNameMenu:Remove() – remove the old panel.

– Second process of creation, detail section.
local Details = vgui.Create( “DFrame” )
Details:SetTitle( “Character details” )
Details:SetSize( 160, 100 )
Details:Center( )
Details:SetDraggable( false )
Details:ShowCloseButton( false )
Details:MakePopup( )

– draw a label.
local detailLabel = vgui.Create( “DLabel”, Details )
detailLabel:SetSize( 110,10 )
detailLabel:SetPos( 0, 50 )
detailLabel:SetText( "Character details! " )
detailLabel:SetTextColor( Color( 255, 0, 0, 255 ) )

– Draw an input for text.
local DetailsTextEntry = vgui.Create( “DTextEntry”, Details )
DetailsTextEntry:SetSize( 120,20 )
DetailsTextEntry:SetPos( 0, 30 )
DetailsTextEntry:SetText( “Character Details” )

– putting a cover.
local DermaImage2 = vgui.Create( “DImageButton”, Details )
DermaImage2:SetPos( ScrW() / 2 - 400, ScrH() / 2 - 100 )
DermaImage2:SetSize( 160, 100 )
DermaImage2:SetImage( “decals/bloodstain_003.vtf” ) – Adding another cover
DermaImage2:SizeToContents()
DermaImage2.DoClick = function()
end

– a button to start the final process.
local DermaButton = vgui.Create( “DButton”, Details )
DermaButton:SetText( “Next” )
DermaButton:SetPos( 600, 350 )
DermaButton:SetSize( 50, 25 )
DermaButton.DoClick = function ()
if ( DetailsTextEntry:GetValue() == “Character Details” ) then
LocalPlayer():PrintChat( “Error!”, false )
else
LocalPlayer():ConCommand( "eng_settitle " … DetailsTextEntry:GetValue() );
Details:Remove()
end – ending the second proccess.
end – another, ending secondary.
end – Another end…
end – added a end, shit is going to get confusing
end
concommand.Add(“firstnamemenu”, FirstNameMenu )[/lua]

What line here is 39?

Heres a hint, Steven. Put your code in [noparse][lua][/lua][/noparse] tags. This makes it readable.

[lua]
–[[
Purpose: Character creation
Base: Yourmuminacan
Derv: cidrp
–]]

– start us out with the base function

function FirstNameMenufunc()
FirstNameMenu = vgui.Create( “DFrame” )
FirstNameMenu:SetTitle( “Character full name” )
FirstNameMenu:SetSize( 160, 100 )
FirstNameMenu:Center( )
FirstNameMenu:SetDraggable( false )
FirstNameMenu:ShowCloseButton( false )
FirstNameMenu:MakePopup( )

– Add a instructions label.
local FirstNameLabel = vgui.Create( “DLabel”, FirstNameMenu )
FirstNameLabel:SetSize( 110,10 )
FirstNameLabel:SetPos( 0, 50 )
FirstNameLabel:SetText( "first and last name! " )
FirstNameLabel:SetTextColor( Color( 255, 0, 0, 255 ) )

– The first name entry.
local FirstNameTextEntry = vgui.Create( “DTextEntry”, FirstNameMenu )
FirstNameTextEntry:SetSize( 120,20 )
FirstNameTextEntry:SetPos( 0, 30 )
FirstNameTextEntry:SetText( “Forename Surname” )

– Draw a texture cover
local DermaImage = vgui.Create( “DImageButton”, FirstNameFrame )
DermaImage:SetPos( ScrW() / 2 - 400, ScrH() / 2 - 100 )
DermaImage:SetSize( 160, 100 )
DermaImage:SetImage( “decals/bloodstain_003.vtf” ) – Texture cover
DermaImage:SizeToContents()
DermaImage.DoClick = function()
end

– Add the next button to continue the character creation process.
local DermaButton = vgui.Create( “DButton”, FirstNameFrame )
DermaButton:SetText( “Next” )
DermaButton:SetPos( 600, 350 )
DermaButton:SetSize( 50, 25 )
DermaButton.DoClick = function ()
if ( FirstNameTextEntry:GetValue() == “” ) then
LocalPlayer():PrintChat( “CHARACTER NOTICE: First/last name missing!”, false )
else
LocalPlayer():ConCommand( "eng_setrpnick " … FirstNameTextEntry:GetValue() );
FirstNameMenu:Remove() – remove the old panel.

– Second process of creation, detail section.
local Details = vgui.Create( “DFrame” )
Details:SetTitle( “Character details” )
Details:SetSize( 160, 100 )
Details:Center( )
Details:SetDraggable( false )
Details:ShowCloseButton( false )
Details:MakePopup( )

– draw a label.
local detailLabel = vgui.Create( “DLabel”, Details )
detailLabel:SetSize( 110,10 )
detailLabel:SetPos( 0, 50 )
detailLabel:SetText( "Character details! " )
detailLabel:SetTextColor( Color( 255, 0, 0, 255 ) )

– Draw an input for text.
local DetailsTextEntry = vgui.Create( “DTextEntry”, Details )
DetailsTextEntry:SetSize( 120,20 )
DetailsTextEntry:SetPos( 0, 30 )
DetailsTextEntry:SetText( “Character Details” )

– putting a cover.
local DermaImage2 = vgui.Create( “DImageButton”, Details )
DermaImage2:SetPos( ScrW() / 2 - 400, ScrH() / 2 - 100 )
DermaImage2:SetSize( 160, 100 )
DermaImage2:SetImage( “decals/bloodstain_003.vtf” ) – Adding another cover
DermaImage2:SizeToContents()
DermaImage2.DoClick = function()
end

– a button to start the final process.
local DermaButton = vgui.Create( “DButton”, Details )
DermaButton:SetText( “Next” )
DermaButton:SetPos( 600, 350 )
DermaButton:SetSize( 50, 25 )
DermaButton.DoClick = function ()
if ( DetailsTextEntry:GetValue() == “Character Details” ) then
LocalPlayer():PrintChat( “Error!”, false )
else
LocalPlayer():ConCommand( "eng_settitle " … DetailsTextEntry:GetValue() );
Details:Remove()
end – ending the second proccess.
end – another, ending secondary.
end – Another end…
end – added a end, shit is going to get confusing
end
concommand.Add(“firstnamemenu”, FirstNameMenu ) [/lua]

Tab your code, and give us the code on the line number.

Will make it so much easier…