• RunConCommand error
    5 replies, posted
Well im learning gmod lua, im makin scripts to learn, whatever, the error is [ERROR] addons/moj nowy mariusz/lua/autorun/kuku.lua:22: '(' expected near 'RunConsoleCommand' and heres the 22th line of code (RunConsoleCommand is binded to a button function DoClick, dont know if that really matters but this error is out of my understanding so it could be anything to me since i just began gmod lua): RunConsoleCommand( "kill" ) This is pretty god damn frustrating because i have the god damn () next to RunConsoleCommand
Post full code in [code] tags
[editline]5th March 2016[/editline] [QUOTE=code_gs;49872258]Post full code in [code] tags[/QUOTE] [CODE] if(SERVER) then end if (CLIENT) then local midW, midH = ScrW() / 2, ScrH() / 2 local function Openasd() local asd = vgui.Create("DFrame") asd:SetSize(250,100) asd:SetPos( midW - ( asd:GetWide() / 2), midH - (asd:GetTall() / 2 )) asd:SetTitle("amriula") local mylame = vgui.create( "DLabel", asd) mylame:SetPos(150, 30) mylame:SetText("jem keczup w kocu") local przyc = vgui.Create("DButton", asd) przyc:SetText( "kilkasd") przyc:SetPos(170,60) przyc.DoClick = function RunConsoleCommand( "kill" ) end end concommand.Add("Openasd",Openasd) end [/CODE]
[QUOTE=Koteu29;49872291][editline]5th March 2016[/editline] [/CODE][/QUOTE] try this [CODE] if(SERVER) then end if (CLIENT) then local midW, midH = ScrW() / 2, ScrH() / 2 local function Openasd() local asd = vgui.Create("DFrame") asd:SetSize(250,100) asd:SetPos( midW - ( asd:GetWide() / 2), midH - (asd:GetTall() / 2 )) asd:SetTitle("amriula") local mylame = vgui.create( "DLabel", asd) mylame:SetPos(150, 30) mylame:SetText("jem keczup w kocu") local przyc = vgui.Create("DButton", asd) przyc:SetText( "kilkasd") przyc:SetPos(170,60) przyc.DoClick = function() --you had missing brackets here RunConsoleCommand( "kill" ) end end concommand.Add("Openasd",Openasd) end [/CODE]
:snip:
Thanks a lot for the help, anyways my code didin't run the way it was supposted to even after that, but thats fixed ( Didin't use caps on create line 14). Thread solved, didin't expect such a quick reply
Sorry, you need to Log In to post a reply to this thread.