Derma won't pop up

When I press F4 Like I set it the derma won’t pop up

Path I put the lua files into C:\Program Files (x86)\Steam\SteamApps\common\GarrysMod\garrysmod\addons\Derma Test\lua\autorun\client

Error when I get on Garrys mod [ERROR] addons/derma test/lua/autorun/client/init.lua:1: attempt to index global ‘GM’ (a nil value)

  1. unknown - addons/derma test/lua/autorun/client/init.lua:1

The two luas I made

cl_init.lua


function DermaTest()
	local base = vgui.Create( "DFrame" )
	local butt = vgui.Create( "DButton" )
		base:SetPos( ScrW()/2 - 225, ScrH()/2 - 100 )
		base:SetSize( 450, 200 )
		base:SetVisible( true )
		base:SetTitle( "Stab Chaze" )
		base:SetDraggable( false )
		base:ShowCloseButton( true )
		base:MakePopup()
		
		butt:SetParent( base )
		butt:SetText( "Kill" )
		butt:Center()
		butt:SetSize( 150, 50 )
		butt.DoClick  = function()
			RunConsoleCommand( "kill" )
		end
end

usermessage.Hook( "Openpls", DermaTest )

init.lua


function GM:ShowSpare2( ply )
	umsg.Start( "Openpls", ply )
	umsg.End()
end


GM is for when you’re making a gamemode. If you want to make it an addon, use hook.add.

It still doesn’t work, I get a new error in my console - [ERROR] addons/derma test/lua/autorun/client/init.lua:1: attempt to index field ‘add’ (a nil value)

  1. unknown - addons/derma test/lua/autorun/client/init.lua:1

New code for init.lua


function hook.add:ShowSpare2( ply )
	umsg.Start( "Openpls", ply )
	umsg.End()
end

That’s not how you use hook.Add

Could you help me use it properly?

This is how hook.Add should be used. http://wiki.garrysmod.com/page/hook/Add

I told you you were doing your hooks wrong Dalapeno. :c