• i dont know the error can you help me?
    7 replies, posted
[code] ---[ERROR] lua/admin.lua:35: 'end' expected (to close 'function' at line 15) near '<eof>'1. unknown - lua/admin.lua:0" local ents = ents.GetAll() local frame = vgui.Create("DFrame") frame:SetSize(1000,720) frame:Center() frame:SetVisible(true) frame:MakePopup() function buttonPressed2() for k, v in pairs( player.GetAll() ) do v:Freeze( true ) end function buttonPressed() for k, v in pairs( player.GetAll() ) do v:Freeze( false ) end local button = vgui.Create("DButton" , frame) button:SetPos(10,500) button:SetSize(200,45) button:SetText("Freeze") button.DoClick = buttonPressed local button2 = vgui.Create("DButton" , frame) button2:SetPos(10,20) button2:SetSize(200,45) button2:SetText("UnFreeze") button2.DoClick = buttonPressed2 local label = vgui.Create("DLabel" , frame) label:SetPos(10,90) label:SetText("ADMIN GG BY MARTOMAGAMING")[/code]
For easier reading of the code please use the [noparse][code]code here[/code][/noparse] tags in the future. Do you get an error in the console?
I don't know the error either since you didn't post it
You're missing 2 end in your for loops. [editline]9th April 2017[/editline] And also [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Player/Freeze]Player:Freeze[/url] is a serverside function so you can't call it in your panel, you will need to network it.
sry im new. the consol say "[ERROR] lua/admin.lua:35: 'end' expected (to close 'function' at line 15) near '<eof>' 1. unknown - lua/admin.lua:0"
Here's the 'fixed' code : [code]concommand.Add("dermatest", function() local ents = ents.GetAll() local frame = vgui.Create("DFrame") frame:SetSize(1000,720) frame:Center() frame:SetVisible(true) frame:MakePopup() function buttonPressed2() for k, v in pairs( player.GetAll() ) do v:Freeze( true ) end --Missing end end function buttonPressed() for k, v in pairs( player.GetAll() ) do v:Freeze( false ) end --Missing end end local button = vgui.Create("DButton" , frame) button:SetPos(10,500) button:SetSize(200,45) button:SetText("Freeze") button.DoClick = buttonPressed local button2 = vgui.Create("DButton" , frame) button2:SetPos(10,20) button2:SetSize(200,45) button2:SetText("UnFreeze") button2.DoClick = buttonPressed2 local label = vgui.Create("DLabel" , frame) label:SetPos(10,90) label:SetText("ADMIN GG BY MARTOMAGAMING") end)[/code] Freeze will not work since it's a serverside function. You can add me on steam if you need more information.
i added you
Wow, you could have just put the error on the forum lol
Sorry, you need to Log In to post a reply to this thread.