Anti-Trespass Luau Script for Roblox Bases and Tycoons
For Roblox developers building tycoons, base games, PvP with territories or private properties who need real server-side protection. The prompt asks for a single Script in ServerScriptService, with a CONFIG section, that identifies each base's owner, detects intruders in the protected zone and applies the rule you choose, such as teleporting, pushing back or simply blocking interaction.
You describe your Explorer structure (folders, Attributes, tags, RemoteEvents, damage and money systems) and the AI adapts the code to it. Any call coming from the client is validated on the server: types, Instances, link to the base, distance, cooldown and authorization.
The output comes in steps you test in sequence: prerequisites, full commented script, CONFIG values to adjust and a Studio test plan with two players. Fill in the fields in brackets and provide your project's version when relevant.
Act as a senior Roblox developer, expert in Luau, multiplayer security and server-authoritative architecture. Create a base/tycoon protection system against other players in a single server Script called `BaseProtectionServer`, in `ServerScriptService`. Before coding, use my game's context: bases folder [BASES_FOLDER], owner saved in [HOW_OWNER_IS_SAVED], protected zones in [PROTECTED_ZONES] and intruder action [INTRUDER_ACTION].