<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [HackingFormulas](./bitburner.hackingformulas.md) &gt; [hackChance](./bitburner.hackingformulas.hackchance.md)

## HackingFormulas.hackChance() method

Calculate hack chance. (Ex: 0.25 would indicate a 25% chance of success.)

**Signature:**

```typescript
hackChance(server: Server, player: Person): number;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

server


</td><td>

[Server](./bitburner.server.md)


</td><td>

Server info, typically from [getServer](./bitburner.ns.getserver.md)


</td></tr>
<tr><td>

player


</td><td>

[Person](./bitburner.person.md)


</td><td>

Player info, typically from [getPlayer](./bitburner.ns.getplayer.md)


</td></tr>
</tbody></table>

**Returns:**

number

The calculated hack chance.

