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

Random Table Values error when making a string. Any fix?

I have checked and all the tables work in print() so it has something to do with changing the value.

Code:

		script.Name.Value = randomStart[math.random(1,18)] .. randomVowel[math.random(1,6)] .. randomLower[math.random(1,18)]

Error: 23:36:26.184 - Workspace.Generation:78: attempt to index string with 'Value'

2 answers

✓ Accepted answer

Replace script.Name.Value with script.Name, the "Value" part is already indicated when reading/writing a property.

.Value is only needed when identifying the Value of a value. For this situation you will need to replace:

script.Name.Value

with

script.Name

Also when getting errors like attempt to index type with thing this means it does not exist, same with attempt to index a nil value

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