Roblox AFK Zone Reward Script (Auto Coin Payout Loop)
Uses reliable spatial queries (GetPartsInPart) instead of buggy TouchEnded events to grant periodic coins to players in an AFK area.
-- Script in ServerScriptService
local Players = game:GetService("Players")
local zone = workspace:WaitForChild("AFKZone") :: BasePart
local INTERVAL = 10
local REWARD = 5
task.spawn(function()
while true do
task.wait(INTERVAL)
local awarded: { [Player]: boolean } = {}
for _, part in ipairs(workspace:GetPartsInPart(zone)) do
local player = Players:GetPlayerFromCharacter(part.Parent)
if player and not awarded[player] then
awarded[player] = true
local coins = player:FindFirstChild("leaderstats") and player.leaderstats:FindFirstChild("Coins")
if coins then coins.Value += REWARD end
end
end
end
end)How to install in Studio
- Create a transparent, non-collidable, anchored Part named AFKZone covering your AFK area.
- Put this Script in ServerScriptService.
- Players standing inside AFKZone receive +5 Coins every 10 seconds.
Tips & customization
- Double the reward for Roblox Premium members with `if player.MembershipType == Enum.MembershipType.Premium then`!
Common questions.
Why use GetPartsInPart instead of Touched/TouchEnded?
TouchEnded fires inconsistently when characters jump or animate; GetPartsInPart is 100% accurate every tick.
More free Luau scripts.
Shift-to-Sprint Script
Hold Left Shift to sprint smoothly with a subtle camera FieldOfView boost and clean speed reset on release.
Double Jump Script
Lets players jump a second time mid-air using Roblox's JumpRequest event (works on PC, mobile, and controller).
Kill Brick Script
Instead of copying 100 scripts into 100 lava bricks, tag any part 'KillBrick' and let one clean server script handle all of them.
Round System Script
A clean server loop that runs Intermission -> Active Round -> Winner announcement and updates a shared Status StringValue for your HUD.
Skip manual wiring.
Let Revix code & playtest it.
Start building freeFree to start. No card needed.

