Shared

The shared section is comprised of methods that both the server and client can do. There is currently only one of these.

Network

The network is essentially a remote wrapper to make code more readable.

createRemoteEvent

This method is only available on the server.

API.network:createRemoteEvent("remoteName",function(player,...)
    print(player,...)
end)

Type

Name

string

remote-name

function

callback

bindRemoteEvent

This method is available on the server and client.

API.network:bindRemoteEvent("remoteName",function(...)
    print(...)
end)

Binding an event on the server will use ".OnServerEvent", and binding an event on the client will use ".OnClientEvent". The "OnClientEvent" is called when ":fireClient" is used, and "OnServerEvent" is called when ":fireServer:" is used.

Type

Name

string

remote-name

function

callback

fireClients

This method is only available on the server.

API.network:fireClients("remoteName",game:GetService("Players"):GetPlayers(),"argument")

This method allows you to fire multiple clients at once. This can also be used with ":fireClient."

Type

Name

string

remote-name

table

player list

fireClient

This method is only available on the server.

API.network:fireClient("remoteName",game:GetService("Players").Player1,"argument")

This method allows you to fire the specified client, you can also send a table of clients (which is what ":fireClients" does.)

Type

Name

string

remote-name

table/player object

player

fireAllClients

This method is only available on the server.

API.network:fireAllClients("remoteName","argument")

This method allows you to instantly fire all clients in the game with your specified arguments.

Type

Name

string

remote name

fireServer

This method is only available on the client.

API.network:fireServer("remoteName","argument")

This method will fire the specified remote event with the arguments you provide.

Type

Name

string

remote-name

createRemoteFunction

This method is only available on the server.

API.network:createRemoteFunction("remoteName",function(player,...)
    return true
end)

This method creates a remote function with the specified name and callback. Values you return will be sent back to the client when they use ":invokeServer."

Type

Name

string

remote-name

function

callback

invokeServer

This method is only available on the client.

API.network:invokeServer("remoteName","argumentToInvoke")

This method will invoke the server for a response that is set with ":createRemoteFunction."

Type

Name

string

remote-name

createBindableEvent

This method is available on the server and client.

API.network:createBindableEvent("bindableName",function(...)
    print(...)
end)

This method will create a bindable event that can be fired with ":fire." Bindable events are essentially remotes but for the client / server to communicate between different scripts.

Type

Name

string

bindable-name

function

callback

fire

This method is available on the server and client.

API.network:fire("bindableName","argument here")

This method will send arguments to the callback you set up with the ":createBindableEvent"

Type

Name

string

bindable-name

createBindableFunction

This method is available on the server and the client.

API.network:createBindableFunction("bindableName",function(...)
    return true
end)

This method will set up a bindable function and whatever the callback returns can be retrieved by using ":invoke."

Type

Name

string

bindable-name

function

callback

invoke

This method is available on the server and the client.

print(API.network:invoke("bindableName","argument"))

This method will invoke the bindable you set up. If you made it return anything, it will print that out.

Type

Name

string

bindable-name

Last updated

Was this helpful?