I keep getting the error "attempt to compare two userdata values" with this part of my script:
for _,v in pairs(children) do if v.Position >= game.Workspace.dud.Position then v:Destroy() end end
As soon as I change == to >= it comes up with that error. Please explain why and tell me how to fix it.
The problem here is that you cannot ask the program to check if a vector is bigger than the other, or a vector is smaller than the other.
Though a way to fix it would be to refer to each axis on its own.
So it would look something like this:
for _,v in pairs(children) do if v.Position.Y >= game.Workspace.dud.Position.Y then -- assuming you want to compare the y-axis v:Destroy() end end
Hope it helped!