πŸŸͺsam.Net.start

Example #1

if SERVER then
    -- This sends it for all players on the server.
    sam.Net.start("test", {
        target = "*",
        1, true, "xd", {1}, {a = 1}
    })

    -- This sends it to all players INSIDE the array.
    sam.Net.start("test", {
        target = {Entity(1), Entity(2), Entity(3)},
        1, true, "xd", {1}, {a = 1}
    })
    
    -- This sends it for just one player.
    sam.Net.start("test", {
        target = Entity(1),
        1, true, "xd", {1}, {a = 1}
    })
end

if CLIENT then
    sam.Net.hook("test", function(number, boolean, string, array, object)
        print(number, boolean, string, array, object)
    end)
end

Example #2

Example #3

Last updated

Was this helpful?