.NET | Need some help

Hello,

im learling Lua for our GMOD Server, i allready done some features (For ex: Own Scoreboard).

Now i want to learn how this .Net working

I created this here:

[DEL]Server file:
[/DEL]


function GM:PlayerInitialSpawn( ply )
	util.AddNetworkString("ErP_WLC_Message")
	print("TEST: Spieler " .. ply:Nick() .. " ist gespawnt")
	net.Start("ErP_WLC_Message")
	net.Send(ply)
end


[DEL]Clientside file[/DEL]


local e_RP_wlcMessage = nil
net.Receive("ErP_WLC_Message", erpwlcmessageshow:show())
function erpwlcmessageshow:show()
	local e_RP_wlcMessage = vgui.Create( "DFrame" ) -- Creates the frame itself
	e_RP_wlcMessage:SetPos( 50,50 ) -- Position on the players screen
	e_RP_wlcMessage:SetSize( 1000, 900 ) -- Size of the frame
	e_RP_wlcMessage:SetTitle( "Testing Derma Stuff" ) -- Title of the frame
	e_RP_wlcMessage:SetVisible( true )
	e_RP_wlcMessage:SetDraggable( true ) -- Draggable by mouse?
	e_RP_wlcMessage:ShowCloseButton( true ) -- Show the close button?
	e_RP_wlcMessage:MakePopup() -- Show the fram
end

But my DarkRP still Crashing without any error. What i did wrong.

I want to show when the Player spawn first time with [DEL]PlayerInitialSpawn[/DEL] that he get showing the Derma Gui.

Someone can help?

First at all is .net is a Microsoft framework, try to create a timer with few seconds and then send the net message, also have to create the útil.AddNetworkString outside playerinitialspawn
Also please, do net.Receive(“I’d”, function() body() end)
That way is far better legible than that monstrosity

net.Receive("ErP_WLC_Message", erpwlcmessageshow:show())

:show() is just executing the function by the way, you need to -pass reference to it as erpwlcmessageshow.show

Remove the () in the second line of the clientside file. In other words, don’t call the function you’re trying to pass to net.Receive.

Special thanks to all of you, im just learning Lua and Gmod Lua, its little hard, but every day i learn more about it.

Thank you for helping :buckteeth: