When talking about part.Position(s), does X, Y, Z apply to all positions?

Hi! I’m currently making a game that requires a lot of copying + pasting of parts. As I said in the title, I want to know whether or not putting “X, Y, Z” in place of “1,3,8” would apply to ALL possible coordinates, regardless of the code, so that way I wouldn’t have to plug in each parts position when placing them.

For example:

local position = script.Parent.Position(X,Y,Z)

Would this work, or would I have to I have to put:

local position = script.Parent.Position(pos1,pos2,pos3)

If someone could let me know, I would greatly appreciate it! Thanks!

1 Like

Not entirely sure what you’re asking here, as both of those lines of code would error.

EDIT:
If you’re asking about casting a Property to a variable, i.e. position, you just need to do

local position = script.Parent.Position

There is no (X, Y, Z)

1 Like

Shoot, I think you’re right. Well, is there any other way I could make it apply to all of them?

I’m not sure what you mean by “all of them”.

Basically, I’m trying to make a house that you’re supposed to blow up (with a rocket launcher), and the house is made up of parts, where if you “blow up” (move) each of the un-anchored parts, it gives you a coin. I’m planning on making the house out of possibly hundreds of blocks.

I made this post because I didn’t want have to copy and paste each of the parts positions into a script that basically says “if part moves from XYZ (its original position), then ‘give coin’.” This could possibly result in me having to paste hundreds of times, in order to make the house function when blown up. Anyway, I’m trying to make a script where instead of me copying and pasting every single part’s position, I can just make a “one size fits all” sort of script (so no copying and pasting each position, instead one line of code would apply to all part’s positions that I duplicate).

I still don’t know how to do this, and I have searched online for at least an hour for a solution, but have found nothing. Since I found nothing, for some odd reason, I thought that possibly “XYZ” could apply to all possible coordinates. That lead me to writing this post, which lead to your reply, which lead to this.

Anyway, sorry I wasted your time, I just needed help. If there is any chance that you could link me a DevForum post on my problem (I searched the DevForum as well, and couldn’t find anything), then it would be much appreciated. If not, that’s ok as well :slight_smile:

Thanks again!