Server
For Server-sided
.Server
Create new Warp event.
lua
(
Identifier: string,
rateLimit: {
maxEntrance: number,
interval: number,
}?
)
lua
local Remote = Warp.new("Remote")
:Connect
Connect event to receive incoming from client way.
lua
(
player: Player,
callback: (...any) -> ()
): string
lua
Remote:Connect(function(player, ...)
print(player, ...)
end)
:Once
This function likely :Connect
but it disconnect the event once it fired.
lua
(
player: Player,
callback: (...any) -> ()
)
lua
Remote:Once(function(player, ...)
print(player, ...)
end)
:Disconnect
Disconnect the event connection.
lua
(
key: string
)
lua
local connection = Remote:Connect(function(player, ...) end) -- store the key
Remote:Disconnect(connection)
:DisconnectAll
Disconnect All the event connection.
lua
Remote:DisconnectAll()
:Fire
Fire the event to a client.
lua
(
reliable: boolean,
player: Player,
...: any
)
lua
Remote:Fire(true, player, "Hello World!")
:Fires
Server Only
Fire the event to all clients.
lua
(
reliable: boolean,
...: any
)
lua
Remote:Fires(true, "Hello World!")
:Invoke
Semiliar to :InvokeClient
, its for Invoke to a client.
lua
(
timeout: number,
player: Player,
...: any
) -> (...any)
lua
local Request = Remote:Invoke(2, player, "Hello World!")
WARNING
This function is yielded, once it timeout it will return nil.
:Wait
Wait the event being triggered.
lua
Remote:Wait()
WARNING
This function is yielded, Invoke might also ping this one and also causing error.
:Destroy
Disconnect all connection of event and remove the event from Warp.
lua
Remote:Destroy()