I currently have this script but the problem with it is, it only prints so far. I want it to actually give money. And another problem is it counts it to fast.
local Players = game:GetService("Players")
local ThisPart = script.Parent --make sure the parent is a part
function Check()
for i, player in pairs(Players:GetPlayers()) do
local Character = player.Character or player.CharacterAdded:Wait()
local RootP = Character:WaitForChild("HumanoidRootPart")
local Dis = (ThisPart.Position-RootP.Position).magnitude --Checks the part/region block's position (you can change "ThisPart" to whatever name you want)
if Dis <= 10 then --if player is close then they get money!
print("Player is near!")
end
end
end
game:GetService("RunService").Heartbeat:Connect(function()
Check()
end)

3 comments
I have a leaderboard with it named "Money". So how would I make it give money? (Sorry i'm rather new at scripting)
No problem - Lemme just update the answer
There u go