Need Help With Derma.

So I’m pretty new to Lua, but I know some of it.

I was wanting to make a good RDM manager for my TTT server since the current one is pretty buggy.
Before adding it to my server, I wanted to make sure there weren’t any errors. If someone could please review it for me and inform me, it’d be appreciated.


function RDMManager( )
	if GM:PlayerDeath = true then
		RunConsoleCommand( "RDMManager" )
	end
end
function RDMMenu( )

local RDM = vgui.Create( "DPanel" )
	RDM:SetSize( 250, 100 )
	RDM:SetColor( 150, 150, 150 )
	RDM:Center()
	RDM:SetTitle( "RDM Manager - By Eazy-E" )
	
local InPutName = vgui.Create( "DTextEntry", RDM )
	InPutName:SetParent( RDM )
	InPutName:SetPos( 10, 2 )
	InPutName:SetSize( 200, 25 )
	InPutName:SetColor( 240, 240, 240 )
	InPutName:SetText( "Name Of RDMer..." )
	
local Cancel = vgui.Create( "DButton", RDM )
	Cancel.SetPos( 20, 60 )
	Cancel.SetText( "Cancel" )
	Cancel.SetSize( 90, 35 )
	Cancel.DoClick = function()
		RDM.Close()
	end
	
local SendReport = vgui:Create( "DButton", RDM )
	SendReport:SetSize( 90, 35 )
	SendReport:SetText( "Send Report!" )
	SendReport:SetPos( 20, 30 )
	SendReport.DoClick = function()
		RunConsoleCommand( "ulx asay " InPutName.SetText "RDM'd Me!(Sent From Manager)" )
	end
end

concommand.Add( "RDMManager", RDMMenu )

Haven’t coded in forever. But this is what caught my eye.
[lua]
function RDMManager( ) //No need to globalize the function.
if GM:PlayerDeath = true then //PlayerDeath is a function. Not a variable. Also there’s no need to compare it. To get the result you are attempting to get, you need to hook in the PlayerDeath function(serverside) and do networking to open the menu.
local RDM = vgui.Create(“DPanel”) //You should change the object to a DFrame. If not, the SetTitle() function you’re calling on it won’t work.
RDM:SetColor() //Isn’t a method for DPanel. Or better yet, change hte object to a DFrame(above) and override the paint function of it.
InPutName:SetParent(RDM) //You already set the parent via the second argument for vgui.Create()
InPutName:SetColor() //Pretty sure SetColor() isn’t a valid method for DTextEntry.
RDM.Close() //Should be RDM:Close()
RunConsoleCommand( "ulx asay " InPutName.SetText “RDM’d Me!(Sent From Manager)” ) //You should be getting the text from the element. Not setting it. Therefore use InPutName:GetText(); it’s a function so make it one. You also need add a comma in front of and behind the function call. Iirc.
[/lua]

[editline]6th November 2014[/editline]

Just for future reference, there’s no reason we should need to look over your code. Put it in YOUR server and test it YOURself next time, please.