if handle.x then before calling on other games.
Handle methods
| Method | Returns | What it tells you |
|---|---|---|
getAmmo() | number? | Rounds in their current weapon. nil if unknown or empty-handed. |
getMaxAmmo() | number? | Magazine capacity of their current weapon. nil if unknown. |
isPlanting() | boolean | true while planting the bomb. |
isDefusing() | boolean | true while defusing the bomb. |
hasC4() | boolean | true if carrying the bomb. |
getArmor() / hasArmor() / hasHelmet() | ArmorState / boolean | Armor info (same shape as api.client.getArmor()). |
isRescuingHostage() / isCarryingHostage() | boolean | Hostage rescue / carry state. |
getMoney() | number | Their current money. 0 if unknown. |
hasDefuseKit() | boolean | true if they carry a defuse kit. |
isInvincible() | boolean | true while they have spawn protection. |
getBacktrackPosition(partName) | Vector3? | World position of partName from the Backtrack snapshot. nil if Backtrack is off, the player is on your team or dead, or no snapshot is held. partName is the part’s child name ("Head", "Torso", "UpperTorso", …). |
Signals
Call:Connect(callback) on these; your callback gets player first. They get cleaned up when your script unloads.
| Signal | Your callback receives |
|---|---|
onPlantingChanged | (player, planting) |
onDefusingChanged | (player, defusing) |
onC4Changed | (player, hasC4) |
onArmorChanged | (player, armor) |
onRescuingChanged | (player, rescuing) |
onCarryingChanged | (player, carrying) |
onMoneyChanged | (player, money) |
onInvincibleChanged | (player, invincible) |
Example
-- Notify when an enemy starts defusing
api.players.onDefusingChanged:Connect(function(player, defusing)
if not defusing then return end
local handle = api.players.get(player)
if handle and handle:getTeam() == api.client.getTeam() then return end
print(`{player.Name} is defusing`)
end)