Need help with TextEntry

Hello, I need help with my VGUi Thingy. i Want the text pepole are writing in the DTextEntry to end up in the record command - RunConsoleCommand( “record”, " I Want TheTextEntry Text here" ) if you understand :S

local Button = vgui.Create( “Button” ) //Create a button that is attached to Frame
Button:SetText( “Record” ) //Set the button’s text to “Click me!”
Button:SetParent( CinemaRecorder )
Button:SetPos( 5, 30 ) //Set the button’s position relative to it’s parent(Frame)
Button:SetWide( 100 ) //Sets the width of the button you’re making
function Button:DoClick( ) //This is called when the button is clicked
RunConsoleCommand( “record”, “test” )
end

local CinemaText = vgui.Create( “DTextEntry”)
CinemaText:SetPos( 20,25 )
CinemaText:SetTall( 20 )
CinemaText:SetWide( 450 )
CinemaText:SetEnterAllowed( true )
CinemaText:SetParent( CinemaRecorder )
end

Help

[lua]
local CinemaText = vgui.Create( “DTextEntry”)
CinemaText:SetPos( 20,25 )
CinemaText:SetTall( 20 )
CinemaText:SetWide( 450 )
CinemaText:SetEnterAllowed( true )
CinemaText:SetParent( CinemaRecorder )

local Button = vgui.Create( “Button” ) //Create a button that is attached to Frame
Button:SetText( “Record” ) //Set the button’s text to “Click me!”
Button:SetParent( CinemaRecorder )
Button:SetPos( 5, 30 ) //Set the button’s position relative to it’s parent(Frame)
Button:SetWide( 100 ) //Sets the width of the button you’re making
function Button:DoClick( ) //This is called when the button is clicked
RunConsoleCommand( “record”, CinemaText:GetValue() )
CinemaText:Clear()
end[/lua]

Untested.

Thank you sir, Gonna test it out now !

And a Question : How do you do that code thingy you did over ?

-snip-

You wrap your code in [noparse][lua][/lua][/noparse] tags.

[noparse][lua]code here[/lua][/noparse] will look this this:

[lua]code here[/lua]

Obviously you’ve never heard of [noparse][noparse][/noparse][/noparse] :downs:

You wrap your [bb]code in [noparse][noparse][/noparse][/noparse] tags.

[noparse][noparse][lua][/lua][/noparse][/noparse] will look this this:

[noparse][lua][/lua][/noparse]

[lua] Bummie
Likes
icecream [/lua]

[editline]09:00PM[/editline]

Strange :S

[editline]09:00PM[/editline]

Thanks for the help ! :slight_smile:

I do but I didnt know they work here too.

[lua] local Button = vgui.Create( “Button” ) //Create a button that is attached to Frame
Button:SetText( “stop” ) //Set the button’s text to “Click me!”
Button:SetParent( CinemaRecorder )
Button:SetPos( 5, 60 ) //Set the button’s position relative to it’s parent(Frame)
Button:SetWide( 100 ) //Sets the width of the button you’re making
function Button:DoClick( ) //This is called when the button is clicked
RunConsoleCommand( “stop” )
end [/lua]

[editline]09:14PM[/editline]

Coooool

Your whitespace skills are horrible.