i want to limit number value to 50
i have this script and tested it but its allowing me to get 51 which i should not be able to get
LIMIT NUMBER VALUE
script.Parent.Triggered:Connect(function(plr)
local Stars = plr:FindFirstChild("Quest"):WaitForChild("Stars")
if Stars.Value < 50 then
print(plr.Name)
script.Parent.Parent:Destroy()
Stars.Value += 1
print(Stars.Value)
end
end)