{"version":3,"file":"teleport.luau","names":[],"sources":["..\\..\\..\\src\\centurion\\commands\\teleport.ts"],"sourcesContent":["/** Command to teleport players to a target player. */\nimport { getHumanoid } from \"@lisachandra/core/utils/main\";\nimport type { CommandContext } from \"@rbxts/centurion\";\nimport { CenturionType, Command, Guard, Register } from \"@rbxts/centurion\";\n\nimport { adminOrDeveloper } from \"../guards\";\n\n@Register()\nexport class TeleportCommand {\n\t/**\n\t * Teleports a group of players to a target player's location. Handles cases where the target\n\t * player's CFrame is invalid.\n\t *\n\t * @param _ - The command context (unused).\n\t * @param from - An array of Player objects to teleport.\n\t * @param target - The Player object representing the target destination.\n\t */\n\t@Command({\n\t\taliases: [\"tp\"],\n\t\targuments: [\n\t\t\t{\n\t\t\t\ttype: CenturionType.Players,\n\t\t\t\tdescription: \"The players to teleport\",\n\t\t\t\tname: \"from\",\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: CenturionType.Player,\n\t\t\t\tdescription: \"The target destination to teleport to.\",\n\t\t\t\tname: \"target\",\n\t\t\t},\n\t\t],\n\t\tdescription: \"Teleports a player or set of players to one target.\",\n\t\tname: \"teleport\",\n\t})\n\t@Guard(adminOrDeveloper)\n\tpublic teleport(_: CommandContext, from: Array<Player>, target: Player): void {\n\t\tconst cf = getHumanoid(target)?.RootPart?.CFrame;\n\n\t\t// Check if the target's CFrame is valid.  If not, the teleport cannot proceed.\n\t\tif (!typeIs(cf, \"CFrame\")) {\n\t\t\treturn;\n\t\t}\n\n\t\tfor (const player of from) {\n\t\t\tconst humanoid = getHumanoid(player);\n\t\t\tconst rootPart = humanoid?.RootPart;\n\n\t\t\t// Force the player to stand up if they are sitting.\n\t\t\tif (humanoid?.Sit === true) {\n\t\t\t\thumanoid.Jump = true;\n\t\t\t}\n\n\t\t\tif (rootPart) {\n\t\t\t\trootPart.CFrame = cf;\n\t\t\t}\n\t\t}\n\t}\n}\n"],"mappings":";;;AACA;AAEA;AAAA;AAAA;AAAA;AAAA;AAEA;AAEA;AAAA;;;;;;;;;;;;;;AA6BE;AAAA;;;;;AAAgD;AAAhD;;AAGA;AACC;AACD;AAEA;AACC;AACA;AAAA;;AAAmC;AAAnC;;AAGA;AAAA;;AAEA;AAFA;AACC;AACD;AAEA;AACC;AACD;AACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAJF","ignoreList":[]}