var/obj/ball/b = new/obj/ball() in locate(3, 3, 1)
Problem description: I want to create a variable obj/ball/b that equals a ball object but only if that is in a specific location (3, 3, 1). I use the above code but it gives error, if I erase the in locate and after code it works though but I want the obj in the above loc...
Also, you already defined the type as part of the variable definition, so you don't need to include the type again.
The in operator is only used to check if something exists in a list or if a number falls within a certain range:
You can use for() to iterate through lists or numbers with the same logic.