Skip to content

Commit

Permalink
RemoteEvent -> UnreliableRemoteEvent
Browse files Browse the repository at this point in the history
  • Loading branch information
osyrisrblx committed Nov 30, 2023
1 parent 60c7023 commit e6c8702
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions include/customDefinitions.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -783,7 +783,7 @@ interface UnreliableRemoteEvent<T extends Callback = Callback> extends BaseRemot
readonly OnClientEvent: RBXScriptSignal<T>;
/** The reason we DON'T allow you to use `Parameters<T>` here is because you can't trust data from the client. Please type-check and sanity-check all values received from the client. E.g. if you are expecting a number from the client, you should check whether the received value is indeed a number and you might also want to make sure it isn't a `NaN` value. See example code:
* ```ts
* (new Instance("RemoteEvent") as RemoteEvent<(num: number) => void>).OnServerEvent.Connect((plr, num) => {
* (new Instance("UnreliableRemoteEvent") as UnreliableRemoteEvent<(num: number) => void>).OnServerEvent.Connect((plr, num) => {
* if (typeIs(num, "number") && num === num) {
* print(`Yay! Valid number: ${num}`);
* } else {
Expand All @@ -793,9 +793,9 @@ interface UnreliableRemoteEvent<T extends Callback = Callback> extends BaseRemot
* ```
*/
readonly OnServerEvent: RBXScriptSignal<(player: Player, ...args: Array<unknown>) => void>;
FireAllClients(this: RemoteEvent, ...args: Parameters<T>): void;
FireClient(this: RemoteEvent, player: Player, ...args: Parameters<T>): void;
FireServer(this: RemoteEvent, ...args: Parameters<T>): void;
FireAllClients(this: UnreliableRemoteEvent, ...args: Parameters<T>): void;
FireClient(this: UnreliableRemoteEvent, player: Player, ...args: Parameters<T>): void;
FireServer(this: UnreliableRemoteEvent, ...args: Parameters<T>): void;
}

interface RemoteFunction<T extends Callback = Callback> extends Instance {
Expand Down

0 comments on commit e6c8702

Please sign in to comment.