Pet amount check not working? attempt to compare number and Instance
Hello.
I am currently attempting to make a barrier where you need a specific amount of pets to go through. I thought this would work by making it go through a for loop, however i get the error attempt to compare number and Instance. Not sure what is caused by this, and would like some help. Here's my script:
01 | local Player = game:GetService( "Players" ).LocalPlayer |
02 | local PetFolder = Player:WaitForChild( "Pets" ) |
04 | local Barrier = workspace:WaitForChild( "5 Pets Barrier" ).Barrier:FindFirstChild( "Main Barrier" ) |
06 | for _, PetAmount in pairs (PetFolder:GetDescendants()) do |
07 | if PetAmount > = 5 then |
08 | Barrier.CanCollide = false |
09 | Barrier.BrickColor = BrickColor.new( "Lime green" ) |
I am stuck on this and would like some help.
Thanks