A fast, easy-to-use net wrapper.
- Drop it anywhere in your project.
- Drop pON into the same directory as Cable (we recommend using this one)
- Include it
if SERVER then
AddCSLuaFile 'pon.lua'
AddCSLuaFile 'cable.lua'
end
include 'cable.lua'
Send a message from server to client:
if SERVER then
cable.send(player, 'message_name', 1, false, { 1, 2, 3 })
else
cable.receive('message_name', function(a, b, c)
print(a, b, c) -- will print 1 false table
end)
end
Send a message from client to server:
if CLIENT then
cable.send('message_name', 1, false, { 1, 2, 3 })
else
cable.receive('message_name', function(player, a, b, c)
print(a, b, c) -- will print 1 false table
end)
end