Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Can a script find objects using number values? [Closed]

Asked by
Sir_Melio 221 Moderation Voter
8 years ago

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?

0
Really don't understand what you're trying to achieve. Do you mean objects within the script that are named as that number? DevChris 235 — 8y
0
Sorry, updated the script, now it makes more sense. Sir_Melio 221 — 8y
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)) M39a9am3R 3210 — 8y
0
Thanks! Sir_Melio 221 — 8y
0
If that was your answer, please close the question so it doesn't look like it still needs a response. RedCombee 585 — 8y

Answer this question