Lua is not executing

Hello, so I’m trying to make a Garry’s Mod server addon but my lua is not executing. I have it in the filepath /data/garrysmod/addons/Node Core/lua/autorun/dankmemes.lua

I also have the code


 if CLIENT then

local frame = vgui.Create("DFrame")
frame:SetSize( 1000, 720 )
frame:Center()
frame:SetVisible( true )
frmae:MakePopup()

end 

I’m trying to make the frame popup when someone joins.

You are running the code too early. Put it in an InitPostEntity hook.

Sorry to be a noob, but how would one go about this.

Move you file to lua/autorun/client, and your code would look like:


hook.Add("InitPostEntity", "UniqueNameHere", function()
   -- Frame code goes here
end)