Could it be possible for someone to make a GUI for this Lua script?
[url]http://www.facepunch.com/showthread.php?991849-Director-s-Mod-Available-now[/url]
[lua]
local frame = vgui.Create( "DFrame" )
frame:SetPos( ScrW() / 2, ScrH() / 2 )
frame:SetSize( 800, 600 )
frame:SetTitle( "Director's Mod" )
frame:SetVisible( true )
frame:SetDraggable( false )
frame:ShowCloseButton( true )
frame:MakePopup()
team_1 = vgui.Create( "DButton", frame )
team_1:SetPos( frame:GetTall() / 2, 5 )
team_1:SetSize( 50, 80 )
team_1:SetText( "dmod_new" )
team_1.DoClick =
RunConsoleCommand( "dmod_new" )
end
team_2 = vgui.Create( "DButton", frame )
team_2:SetPos( frame:GetTall() / 2, 105 )
team_2:SetSize( 50, 80 )
team_2:SetText( "dmod_anim" )
team_2.DoClick =
RunConsoleCommand( "dmod_anim" )
end
concommand.Add("dmod_new", dmod_new)
concommand.Add("dmod_anim", dmod_anim)
[/lua]
I don't have any idea at all if it'll work.
Where do i install this lua code?
autorun/client
[QUOTE=Zeroi;25546799][lua]
local frame = vgui.Create( "DFrame" )
frame:SetPos( ScrW() / 2, ScrH() / 2 )
frame:SetSize( 800, 600 )
frame:SetTitle( "Director's Mod" )
frame:SetVisible( true )
frame:SetDraggable( false )
frame:ShowCloseButton( true )
frame:MakePopup()
team_1 = vgui.Create( "DButton", frame )
team_1:SetPos( frame:GetTall() / 2, 5 )
team_1:SetSize( 50, 80 )
team_1:SetText( "dmod_new" )
team_1.DoClick =
RunConsoleCommand( "dmod_new" )
end
team_2 = vgui.Create( "DButton", frame )
team_2:SetPos( frame:GetTall() / 2, 105 )
team_2:SetSize( 50, 80 )
team_2:SetText( "dmod_anim" )
team_2.DoClick =
RunConsoleCommand( "dmod_anim" )
end
concommand.Add("dmod_new", dmod_new)
concommand.Add("dmod_anim", dmod_anim)
[/lua]
I don't have any idea at all if it'll work.[/QUOTE]
WHy are you adding concommands? dmod_new and dmod_anim are not function either...
[editline]21st October 2010[/editline]
[lua]--Thanks Yakahughes for derma designer making this alot quicker andeasier to make :D
local unit
local adnimdmod
local dmpanel2
local dmnew
local dmpanel
local DMF
function DMMenu()
DMF = vgui.Create('DFrame')
DMF:SetSize(ScrW()/2, ScrH/2)
DMF:SetPos(63, 46)
DMF:SetTitle('Directors Mod')
DMF:SetSizable(false)
DMF:MakePopup()
dmpanel = vgui.Create('DPanel')
dmpanel:SetSize(68, 30)
dmpanel:SetPos(65, 70)
dmnew = vgui.Create('DButton')
dmnew:SetParent(dmpanel)
dmnew:SetSize(62, 25)
dmnew:SetPos(3, 2)
dmnew:SetText('New Dmod')
dmnew.DoClick = function()
RunConsoleCommand("dmod_new")
end
dmpanel2 = vgui.Create('DPanel')
dmpanel2:SetParent(DMF)
dmpanel2:SetSize(68, 30)
dmpanel2:SetPos(72, 24)
adnimdmod = vgui.Create('DButton')
adnimdmod:SetParent(dmpanel2)
adnimdmod:SetSize(62, 25)
adnimdmod:SetPos(3, 2)
adnimdmod:SetText('Dmod Anim')
adnimdmod.DoClick = function()
RunConsoleCommand("dmod_anim")
end
unit = vgui.Create('DLabel')
unit:SetParent(DMF)
unit:SetPos(16, 58)
unit:SetText('Made by C to the UNIT')
unit:SizeToContents()
unit:SetTextColor(Color(255, 0, 0, 255))
end
concommand.Add("dm_menu", DMMenu)[/lua]
That [b]should[/b] work!
I have received this error.
[quote]
] dm_menu
[lua\autorun\client\dmod_gui.lua:11] attempt to perform arithmetic on global 'ScrH' (a function value)
[/quote]
Ah, try this
[lua]--Thanks Yakahughes for derma designer making this alot quicker andeasier to make :D
local unit
local an
local pane
local anim
local pan
local dmf
function DMMenu()
dmf = vgui.Create('DFrame')
dmf:SetSize(163, 78)
dmf:SetPos(ScrW()/2, ScrH()/2)
dmf:SetTitle('Directors Mod')
dmf:MakePopup()
pan = vgui.Create('DPanel')
pan:SetParent(dmf)
pan:SetSize(78, 34)
pan:SetPos(3, 25)
anim = vgui.Create('DButton')
anim:SetParent(pan)
anim:SetSize(70, 25)
anim:SetPos(4, 4)
anim:SetText('New Dmod')
anim.DoClick = function()
RunConsoleCommand("dmod_new")
end
pane = vgui.Create('DPanel')
pane:SetParent(dmf)
pane:SetSize(78, 34)
pane:SetPos(83, 25)
an = vgui.Create('DButton')
an:SetParent(pane)
an:SetSize(70, 25)
an:SetPos(3, 4)
an:SetText('Dmod Anim')
an.DoClick = function()
RunConsoleCommand("dmod_anim")
end
unit = vgui.Create('DLabel')
unit:SetParent(dmf)
unit:SetPos(21, 62)
unit:SetText('-Made by C to the UNIT-')
unit:SizeToContents()
unit:SetTextColor(Color(255, 0, 0, 255))
end
concommand.Add("dm_menu", DMMenu)[/lua]
That should work, forgot the opening and closing parentheses!
Sorry, you need to Log In to post a reply to this thread.