# Play Time

<figure><img src="/files/8NSZRRgqQ41B7TBgVaB7" 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


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://0bugscripts.gitbook.io/0bugscripts/infinity-scripts/play-time.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
