-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: implement
numArgs
, allowing for a variable number of inputs f…
…or a single argument
- Loading branch information
1 parent
81d54db
commit b51e86d
Showing
7 changed files
with
153 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { | ||
CenturionType, | ||
Command, | ||
CommandContext, | ||
Register, | ||
} from "@rbxts/centurion"; | ||
|
||
@Register() | ||
export class KickCommand { | ||
@Command({ | ||
name: "kick", | ||
description: "Kicks a player", | ||
arguments: [ | ||
{ | ||
name: "player", | ||
description: "Player to kick", | ||
type: CenturionType.Player, | ||
}, | ||
{ | ||
name: "reason", | ||
description: "Reason for kicking the player", | ||
type: CenturionType.String, | ||
numArgs: "rest", | ||
}, | ||
], | ||
}) | ||
kick(_: CommandContext, player: Player, reason: string[]) { | ||
const reasonText = reason.join(" "); | ||
print(`Kicked ${player.Name} for ${reasonText}`); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { | ||
CenturionType, | ||
Command, | ||
CommandContext, | ||
Register, | ||
} from "@rbxts/centurion"; | ||
|
||
@Register() | ||
export class TeleportCommand { | ||
@Command({ | ||
name: "teleport", | ||
description: "Teleports to a position", | ||
arguments: [ | ||
{ | ||
name: "position", | ||
description: "Coordinates to teleport to", | ||
type: CenturionType.Number, | ||
numArgs: 3, | ||
}, | ||
], | ||
}) | ||
teleport(ctx: CommandContext, coords: number[]) { | ||
const pos = new Vector3(coords[0], coords[1], coords[2]); | ||
ctx.executor.Character?.PivotTo(new CFrame(pos)); | ||
ctx.reply(`Teleported to ${pos}`); | ||
} | ||
} |