> For the complete documentation index, see [llms.txt](https://0bugscripts.gitbook.io/0bugscripts/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://0bugscripts.gitbook.io/0bugscripts/infinity-scripts/play-time.md).

# Play Time

<figure><img src="https://3424912082-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F89arMlYkHza1FJDvW36X%2Fuploads%2FCQ5vKVsf1lD8LAkss7C1%2FPLAY%20TIME%20SHOP%20(9).png?alt=media&amp;token=b7e5753d-4252-4af5-ac70-67213bec53d3" alt=""><figcaption><p>FiveM PlayTime - Play &#x26; Earn Script</p></figcaption></figure>

\
**0BugScripts PlayTime Shop** is an advanced, plug-and-play reward system for FiveM servers that transforms player activity into meaningful in-game progression. Built with full compatibility for **QBCore**, **QBox**, and **ESX**, this system encourages long-term player engagement by rewarding time spent online!

### Overview

{% embed url="<https://youtu.be/KEUBPTrBjmQ>" %}
FiveM Play and Earn&#x20;
{% endembed %}

> ⏱ **Play to Earn System**

Players automatically earn coins by staying active on the server. Configurable reward intervals, such as **10 coins every 15 minutes**.

> 🔐 **Secure Progress Tracking**

Player progress is saved when they disconnect and resumes when they return — no farming or restarts.<br>

> **⚙️ Fully Configurable**

Adjust reward frequency, coin amounts, and shop items directly from `config.lua`.

> **🧠 Framework Auto-Detection**

Supports **QBCore**, **QBox**, and **ESX** out of the box. No extra setup needed.

### Detailed Features :&#x20;

### 🛒 Playtime Shop

* Organized into categories: **Tools**, **Weapons**, **Vehicles**
* Easily add items with attributes like `id`, `label`, `price`, `type`, `image`, etc.
* Validates all purchases server-side to prevent exploits
* Vehicle rewards are auto-registered in the database (plate, garage, mods, etc.)

### 🏆 Leaderboards

* Showcases top players with the most earned coins
* Dynamic rank calculation (equal balances share rank)
* Auto-refresh every 5 minutes, instant updates on actions

### 🎁 Real-Time Reward System

* UI shows progress bar, time remaining, and next coin reward
* Add custom hooks for giving items, XP, or other rewards alongside coins

### 💸 Time-Limited Deals

* Rotating daily/weekly deals
* Multiple sessions with start/end times
* Built-in countdown timer for players

### 🎟️ Tebex-Compatible Code Redemption

* Players can redeem **promo codes** generated from Tebex or other tools
* One-time use codes with secure database tracking
* Anti-spam and anti-exploit protection built-in

### ⚙️ Developer & Performance Friendly

* Auto-creates all required SQL tables
* Works with **oxmysql**, **ghmattimysql**, and **mysql-async**
* Escrow-safe: config files remain editable
* Optimized and scalable for 1000+ players
