Sorry to ask such a simple question, but I've been scratching my head at this for a while now. I have a script that generates a local part and automatically destroys it when Rebirths, a leaderstats value, is >= 1. Here is the script:
local Player = game.Players.LocalPlayer
local Leaderstats = Player:WaitForChild('leaderstats')
local Rebirths = Leaderstats.Rebirths
local Part = Instance.new('Part')
Part.Parent = game.Workspace
Part.Size = Vector3.new(5, 50, 410)
Part.Position = Vector3.new(80, 0, 0)
Part.Anchored = true
Part.Transparency = 0.5
Part.BrickColor = BrickColor.Red()
wait()
if Rebirths.Value >= 1 then
print('Milestone')
Part:Destroy()
end
This is the script, and for some reason after I rebirth for the first time (and ''Rebirths'' changes to 1) nothing happens.
Here is the important part: For some reason, when I change the final If statement to >= 0 INSTEAD of >= 1, it works completely fine, printing Milestone and destroying the Local Part. Why is this?

1 comment
I honestly have no idea how this flew over my head, but thank you.