i made a script that is supposed to give you 1 point every second on the leaderboard as long as you stay in the certain region. i use this for a KOTH gamemode.
local RegionPart = game.Workspace.Regioner
local pos1 = RegionPart.Position - (RegionPart.Size / 2)
local pos2 = RegionPart.Position + (RegionPart.Size / 2)
local region = Region3.new(pos1, pos2)
while true do
wait()
local partsInRegion = workspace:FindPartsInRegion3(region, nil, math.huge)
db = false
for i, part in pairs(partsInRegion) do
if part.Parent:FindFirstChild("Humanoid") then
local player = game.Players:GetPlayerFromCharacter(partsInRegion)
if db == false then
db = true
player.leaderstats.Points.Value = player.leaderstats.Points.Value + 1
wait(1)
db = false
print("Player found: ".. part.Parent.Name)
local char = part.Parent.Name
end
end
end
end
im a noobie to scripting soo
