Examples
Ready-to-use script examples for Perc Tarkov.
Custom ESP
Draw custom ESP with player names, health, and distance.
custom-esp.as
void OnTick() {
array<Player@> players = GetPlayers();
Player@ local = GetLocalPlayer();
if (local is null) return;
for (uint i = 0; i < players.length(); i++) {
Player@ p = players[i];
if (!p.IsAlive()) continue;
Vector3 headPos = p.GetBonePosition(0); // Head
Vector2 screenPos;
if (WorldToScreen(headPos, screenPos)) {
string info = p.GetName() + " [" + int(p.GetHealth()) + "hp] " + int(p.GetDistance()) + "m";
Color col = p.IsVisible() ? Color(0, 255, 0, 255) : Color(255, 0, 0, 255);
DrawText(screenPos, info, col, 12.0);
}
}
}High-Value Loot Alert
Plays a visual alert when high-value loot is nearby.
loot-alert.as
void OnTick() {
array<LootItem@> items = GetLootItems();
for (uint i = 0; i < items.length(); i++) {
LootItem@ item = items[i];
if (item.GetValue() > 50000 && item.GetDistance() < 100) {
Vector2 screenPos;
if (WorldToScreen(item.GetPosition(), screenPos)) {
string text = item.GetName() + " (" + item.GetValue() + "₽)";
DrawText(screenPos, text, Color(255, 215, 0, 255), 14.0);
DrawRect(
Vector2(screenPos.x - 5, screenPos.y - 5),
Vector2(10, 10),
Color(255, 215, 0, 100),
5.0
);
}
}
}
}PMC/Scav Counter
Displays a count of alive PMCs and Scavs in the raid.
player-counter.as
void OnTick() {
array<Player@> players = GetPlayers();
int pmcCount = 0;
int scavCount = 0;
for (uint i = 0; i < players.length(); i++) {
if (!players[i].IsAlive()) continue;
if (players[i].IsPMC()) pmcCount++;
if (players[i].IsScav()) scavCount++;
}
DrawText(Vector2(10, 10), "PMCs: " + pmcCount, Color(255, 100, 100, 255), 14.0);
DrawText(Vector2(10, 30), "Scavs: " + scavCount, Color(100, 255, 100, 255), 14.0);
}Closest Threat Indicator
Draws a line to the nearest visible enemy.
threat-indicator.as
void OnTick() {
array<Player@> players = GetPlayers();
Player@ closest = null;
float closestDist = 999999;
for (uint i = 0; i < players.length(); i++) {
Player@ p = players[i];
if (!p.IsAlive() || !p.IsVisible()) continue;
float dist = p.GetDistance();
if (dist < closestDist) {
closestDist = dist;
@closest = p;
}
}
if (closest !is null) {
Vector2 screenPos;
Vector3 headPos = closest.GetBonePosition(0);
if (WorldToScreen(headPos, screenPos)) {
// Draw line from bottom center of screen to enemy
DrawLine(
Vector2(960, 1080), // Adjust to your resolution
screenPos,
Color(255, 50, 50, 200),
2.0
);
DrawText(screenPos, int(closestDist) + "m", Color(255, 50, 50, 255), 12.0);
}
}
}Last updated on