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

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

Asked by 4 years ago

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

Log in to vote
2
Answered by 4 years ago

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

Ad
Log in to vote
1
Answered by 4 years ago
Edited 4 years ago

.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

Answer this question