Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

how do i use >= in a script properly?

Asked by 6 years ago

when this script runs it doesn't print but there's no error

script.Parent.Touched:connect(function(hit)
    if hit.Parent:FindFirstChild ("leaderstats") then
        if  hit.Parent:FindFirstChild ("leaderstats").Points.Value  >=  2 then
        print ("working")
        end
        end
end)

2 answers

Log in to vote
0
Answered by
chasedig1 115
6 years ago

This is how I use it in my game; while game.ServerStorage.DoughValue.Value >= 1 and currentAmount <= 2 do

Try to do the same, but with your code. I don't understand what you're trying to do.

Ad
Log in to vote
0
Answered by 6 years ago

So, it is pretty basic. If the points value is BIGGER (>) or EQUAL (=) to 2, then the print should print.

You can remove the = to get only a higher number do the print, and you can also change it the other way around.

Answer this question