Checking if sprite is at an X & Y Coordinate?

Hello, I need help with checking the position of a sprite to see if it matches coordinates that I want it to be at, for example, I have a block that is located at 100,100 and when I move it to 50,50 I want to be able to check if it has been set to 50,50 with the click of a button, and if it hasn’t, it should let me know as well

I’ve tried this, but I can’t get the block to lock into the if statement

Hey @uberfile986yv284, welcome to the community and thanks for posting! :waffle:

it doesn’t work because the if block only accepts a true/false input. that block would reurn a value.

instead, you would want to use something like:

if {[sprite 1’s X = 50] and [sprite 1’s Y = 50]}
do set label ShowWinner text = “it’s in place”
else set label ShowWinner text = “it’s not in place”

also, it looks as if you are using ThunkableX so i have moved this post to the appropriate forum #thunkable-cross

How would I go about doing that? is it possible to do with blocks or can i somewhere write my own code for it to function as I want it to? If not, can you post a screenshot of the blocks aligned like that, I don’t see a

if(sprite1.X == 50 & sprite1.Y == 50)