I tried to make a system that when the leaderstats reaches zero, the player takes damage. I've tried lots of methods, bit it still don't work
local Players = game:GetService("Players")
local plr = Players.LocalPlayer
local PlayerMoneyValue = plr.leaderstats.Reality.Value
while true do
wait(0.5)
if PlayerMoneyValue < 1 then
plr.Parent.Humanoid:Takedamage(10)
end
end

2 comments
I edited the answer
Edit: Added code block