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
API.network:createRemoteEvent("remoteName",function(player,...)
print(player,...)
end)
Type
Name
string
remote-name
function
callback
bindRemoteEvent
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
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
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
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
API.network:fireServer("remoteName","argument")
This method will fire the specified remote event with the arguments you provide.
Type
Name
string
remote-name
createRemoteFunction
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
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
Bindable events do not replicate, meaning the client cannot fire the server and vice-versa.
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
Bindable events do not replicate, meaning the client cannot fire the server and vice-versa.
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
Bindable functions do not replicate, meaning the client cannot invoke the server and vice-versa.
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
Bindable functions do not replicate, meaning the client cannot invoke the server and vice-versa.
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?