For example, we have an object and this script is its parent. The number is unknown as we don't know yet what the player is gonna put the number in the variable as.

YourId = 00112233

Instance.new("Part", script).Name = YourId

-- Example 1
script:FindFirstChild(YourId)

-- Example 2
script[YourId]

Those did not work for me, any ideas?

5 comments

0

Really don't understand what you're trying to achieve. Do you mean objects within the script that are named as that number?

0

Sorry, updated the script, now it makes more sense.

0

You'd want to use Example 1. But you would want to use the tostring function on the YourId. So it should look like script:FindFirstChild(tostring(YourId))

0

Thanks!

0

If that was your answer, please close the question so it doesn't look like it still needs a response.