Hello, I have this problem where im not able to pool a message (I'v just started learning lua so im no expert). I can't get the server to send the "I Recieved The Message" text.
Here is the server script to pool and recieve the message:
[B]
util.AddNetworkString("10")
net.Receive("10",function()
print("I Recieved The Message")
end)[/B]
Here is the client side script to create my frame, button, and send the number:
[B]local frame = vgui.Create("DFrame")
frame:SetSize(100,100)
frame:SetVisible(true)
frame:Center()
frame:MakePopup()
local b = vgui.Create("DButton",frame)
b.DoClick = function()
net.Start("10")
net.SendToServer()
end
[/B]
Just so you know, using [lua] code tags (Instead of [B] you are currently using) can really make it easier to read codes in posts
As for your code - It's working alright.
I put it on a local server and ran it, everything works fine.
What error are you getting? Usage of the word pool makes me think you're only running it on the client, never truly calling AddNetworkString
[QUOTE=JasonMan34;51152672]Just so you know, using [lua] code tags (Instead of [B] you are currently using) can really make it easier to read codes in posts
As for your code - It's working alright.
I put it on a local server and ran it, everything works fine.
What error are you getting? Usage of the word pool makes me think you're only running it on the client, never truly calling AddNetworkString[/QUOTE]
This is the error i got after running test_server.lua using lua_openscript, and test_client.lua using lua_openscript_cl (after i press the button):
[ERROR] lua/test_client.lua:10: Calling net.Start with unpooled message name! [[url]http://goo.gl/qcx0y][/url]
1. Start - [C]:-1
2. DoClick - lua/test_client.lua:10
3. unknown - lua/vgui/dlabel.lua:218
Addnetworkstring must be called serverside, not clientside
ok I got it to work. I had to wait 5 minutes before pressing the button. I didnt change any of the code either. Thanks for the help guys.
Sorry, you need to Log In to post a reply to this thread.