Overview:
This script is designed for a lumberjack-themed gameplay feature, where players can interact with trees to chop wood and complete tasks for rewards. It includes NPC interaction, task generation, and tree chopping mechanics.
Features:
Tree Generation and Blips:
- GenerateTrees: Spawns trees at predefined locations with random positioning. Limits the number of trees based on the config.
- Blips: Displays map markers (blips) for the trees and the NPCs for easy navigation.
Chopping Trees:
- ChopTree: Handles the tree chopping action. Players need an axe to chop trees, and progress is shown with a bar. Once a tree is chopped, it respawns after a set period.
- Cooldown: Prevents players from starting another task immediately after completing one, requiring a cooldown period before new tasks are available.
Tasks:
- Task Generation: Randomly generates tasks, such as gathering a certain number of items (e.g., wood or chopped wood).
- Task Completion: Players can complete tasks by delivering the required items. On task completion, the appropriate items are removed from the player’s inventory, and rewards (e.g., money) are given.
NPC Interaction:
- NPC Ped: An NPC is placed at a specific location and performs a scenario (e.g., smoking a cigarette). Players can interact with this NPC to open a task menu.
- Ped Blip: An additional map blip is used to indicate the NPC, making it easy for players to find and interact with.
Preview - https://youtu.be/UG1_CNP6BWw
This script provides a comprehensive lumberjack gameplay experience, including task completion, tree interaction, and NPC-based task management.
Requirements:
- ESX
- OxMysql
- Oxlib
- OxInventory (For now only)
The script is partly encrypted using FiveM Escrow