Open Panel Error

Error:



[ERROR] lua/addonname.lua:47: ')' expected (to close '(' at line 42) near 'end'
  1. unknown - lua/addonname.lua:0


Command to open the panel:


if (CLIENT) then
    net.Receive("__hkOpenDialog",function()
        if LocalPlayer() == net.ReadEntity() then


if (SERVER) then
    local fcSendMsg = function(hPlayer)
        util.AddNetworkString("__hkOpenDialog")
        net.Start("__hkOpenDialog")
        net.WriteEntity(hPlayer)
        net.Broadcast()
    end

 hook.Add("PlayerSay","m_hkPlayerSayDialogCommand",function(hPlayer,sText)  --- Line 42
            if sText == "!openmenu" then
                fcSendMsg(hPlayer)
            	end
       	end
   	end) --- Line 47
end

Remove the end above — Line 47

If you indent things correctly, ends won’t stack on top of each other like they do there, if they do, then you know you did something wrong or chose to indent that way.

The error says what you should be doing-

[editline]26th March 2016[/editline]

ninja’d

Like this ?


     hook.Add("PlayerSay","m_hkPlayerSayDialogCommand",function(hPlayer,sText)
            if sText == "!coinflip" then
                fcSendMsg(hPlayer)
            	end
   	end )  --- Line 47
end 


Didnt work

thats the error now



[ERROR] lua/addonname.lua:48: 'end' expected (to close 'if' at line 5) near '<eof>'
  1. unknown - lua/adonname.lua:0


Could you please provide us your (current) full code?

thats almost my full code the only thing more i have its a panel (


local NAME = vgui.Create ( "DFrame" ) 

)

My full code


-- Command

if (CLIENT) then
    net.Receive("__hkOpenDialog",function()
        if LocalPlayer() == net.ReadEntity() then
-- Start Coding

local  openpanel = vgui.Create ( "DFrame" )
	openpane:SetTitle("")
	openpanel:SetSize(900,600)
	openpanel:Center()
	openpanel:MakePopup()


-- Command

if (SERVER) then
    local fcSendMsg = function(hPlayer)
        util.AddNetworkString("__hkOpenDialog")
        net.Start("__hkOpenDialog")
        net.WriteEntity(hPlayer)
        net.Broadcast()
    end

    hook.Add("PlayerSay","m_hkPlayerSayDialogCommand",function(hPlayer,sText)
            if sText == "!openpanel" then
                fcSendMsg(hPlayer)
        end
   	end )
end 

Try this:


if (CLIENT) then
    net.Receive("__hkOpenDialog",function()
        if LocalPlayer() == net.ReadEntity() then

			local openpanel = vgui.Create ( "DFrame" )
			openpane:SetTitle("")
			openpanel:SetSize(900,600)
			openpanel:Center()
			openpanel:MakePopup()
		end
	end)
end

if (SERVER) then

	util.AddNetworkString("__hkOpenDialog")

    local function fcSendMsg(hPlayer)

        net.Start("__hkOpenDialog")
        net.WriteEntity(hPlayer)
        net.Broadcast()

    end

    hook.Add("PlayerSay","m_hkPlayerSayDialogCommand",function(hPlayer,sText)

        if sText == "!openpanel" then
            fcSendMsg(hPlayer)
        end

   	end )
end