Points In-Area per second

Greetings,
I wanted to know how could I award players a point per second staying in a specific area of the map to be shown in the leaderboard.

1 Like

First you’ll need a loop. Put this in a ServerScript and put that in the ServerScriptService

while wait(1) do
    -- code goes here
end

Next, I would familiarize yourself with some of the techniques described here: How do I accurately check if a player is in a certain area?

When you pick a technique you like, either FindPartsInRegion3, GetTouchingParts, or even just checking if their character’s PrimaryPart position is within certain boundaries, you’ll put that code in the loop.

Once you’re able to determine that the player is in the area, you’re going to need to award them points towards their leaderstat, which will be pretty simple since it sounds like you’re using Roblox’s default In-Experience Leaderboards | Roblox Creator Documentation. Just find the name of your points stat, and add to its current value.

Thanks a lot! I was having difficulty checking the player’s presence in a particular part of the map

1 Like