GlobeClear β World Cleanup System for FiveM
Overview π
GlobeClear is a lightweight world cleanup system for FiveM servers. It allows server administrators to trigger a full server-side cleanup of peds, vehicles, and objects after a countdown, notifying players with a smooth UI experience. Optional Discord role-based permissions let you restrict who can execute the cleanup.
Features β¨
- 30-second pre-cleanup countdown with customizable title & message
- Automatic removal of:
- Non-player Peds
- Empty Vehicles
- World Objects
- Clear "World Cleared!" final message with short countdown
- Optimized entity enumeration to prevent crashes
- Discord ACL: restrict command usage by role ID
Installation π¦
- Move the GlobeClear resource folder into your server's
resources/
directory. - Add
ensure GlobeClear
to your server.cfg, Orrefresh
thenensure GlobeClear
[Note, permissions may NOT work this way]
Configuration βοΈ
Configure behavior inside config.lua
:
Config.ClearPeds = true
Config.ClearVehicles = true
Config.ClearObjects = true
Config.Notification = {
title = "WorldClear",
startText = "Cleanup startingβ¦",
finishText = "Cleanup complete!"
}
-- Discord ACL settings
Config.DiscordToken = "YOUR_BOT_TOKEN_HERE" -- Bot token (prefixed with "Bot ")
Config.DiscordGuildId = "YOUR_GUILD_ID_HERE" -- Discord server (guild) ID
Config.AllowedDiscordRoleId= "123456789012345678" -- Role ID allowed to run /worldclear
Discord ACL π
GlobeClear can call the Discord API directly to verify a player's roles. Players possessing the configured role ID in your guild will be allowed to execute /worldclear
in-game.
Ensure you have HTTP requests enabled and your bot has guilds.members.read
(or appropriate) permissions.
Usage π
Both the server console and in-game players with the required Discord role can trigger a world cleanup:
/worldclear
This will initiate a 30-second countdown for all players, followed by entity removal and a final notification.
Scripts π
client.lua
β Handles countdown UI and entity cleanup.server.lua
β Registers the/worldclear
command, checks Discord role via REST API, and triggers the event.config.lua
β Configuration options for GlobeClear behavior, notifications, and Discord ACL.