✓ Accepted answer
You might want to considering limiting your use to infinite loops whenever possible. You could track changes to properties of an object use the Changed event, which is a lot more efficient.
You also made a little error in checking the value of StatPoints on line 5 ( >1=)
Finally if on one line you are checking for (greater than or equal to) and on the other you are checking (less than or equal to), both statements would be true, therefore both different codes would run
player = game.Players.LocalPlayer
statsBin = player:WaitForChild('bin')
statPoints = statsBin:WaitForChild('StatPoints')
statPoints.Changed:connect(function (property)
if tostring(property) == 'Value' then
if statPoints[property] > 1 then
script.Parent.Visible = false
elseif statPoints[property] < 1 then
scrippt.Parent.Visible = true
end
end
end)
2 comments
is bin in youre backpack then do p.Backpack.bin
bin isnt backpack bin is like leaderstats