Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How Can I Reference Objects With A Randomly Generated Name?

On the start of my game, a few "special" objects will have their name changed to a randomly generated key. To note, i'm just doing this to make it a little more time consuming to exploit key aspects of my game, I DO NOT think this will end exploiting once and for all.

Now my issue you may ask, is referencing that object from other scripts. I have no problem referencing the object from the script the name was changed in. However, I need help figuring out how I can correctly identify that object from other scripts throughout my game.

I KNOW it's possible to do this as i've seen people use this method in their games, I just can't figure out how they're referencing objects from many different scripts throughout the game.

3 comments

0

Before the names of the objects are randomized add them to a table with their unrandomized name being the key and the value being a reference to the object. Then when you need that object simply access the table.

0

Before the names of the objects are randomized add them to a table with their unrandomized name being the key and the value being a reference to the object. Then when you need that object simply access the table.

0

Before the names of the objects are randomized add them to a table with their unrandomized name being the key and the value being a reference to the object. Then when you need that object simply access the table.

1 answer

local a = math.random
local oof = {}
table.insert(a,oof)

they will be in order so you can grab them by number

4 comments

0

it's not perfect but i'm exhausted and this isnt my best answer

0

The key name is actually a GUID, math.random is more likely to repeat numbers.

0

good to know

0

Random:NextInteger(0,9999999999999999) its over 9000?

This discussion is preserved as it was. New answers, comments, and votes are closed.