So i'm coding my DFrame for an addon im working on and I keep getting this error.
"[ERROR] addons/dareaddon/lua/autorun/sh.lua:25: 'end' expected (to close 'if' at line 5) near ''"
Here is my original code.
if (CLIENT) then
local midW, midH = ScrW() / 2, Scrh() / 2
local function OpenMyDerma()
local MyDerma = vgui.Create( "DFrame" )
MyDerma:SetSize( 250, 250 )
MyDerma:SetPos( midW - ( MyDerma:GetWide() / 2 ), midH - ( MyDerma:GetTall() / 2) )
MyDerma:SetTitle( "OriginalServers Jailbreak" )
local MyLabel = vgui.Create( "DLabel", MyDerma )
MyLabel:SetPos( 90, 30 )
MyLabel:SetText( "LabelTest" )
local MyButton = vgui.Create( "DButton", MyDerma )
MyButton:SetText( "Click to die." )
MyButton:SetPos( 90, 60 )
MyButton.DoClick = function()
RunConsoleCommand( "explode" )
end
end
concommand.Add( "openderma", OpenMyDerma )
end
this code is kind of hard to understand with the indents so here is a screenshot. Code Screenshot
any help is greatly appreciated.