So I created an Array with loads of names. then used math.random to select a random name but it always gives me a number between 1 and however many there are. Here is the code.
1 | local names = { "Tom" , "Jesse" , "Olivia" } |
2 | local randName = math.random( 1 , #names) |
3 | script.Parent.BasePlate.Name = "" ..randName |
try this:
1 | local names = { "Tom" , "Jesse" , "Olivia" } |
2 | local randName = math.random( 1 , #names) |
3 | local actualname = names [ randName ] |
4 | workspace.Baseplate.Name = "" ..actualname |
you're trying to rename baseplate to randName which isnt a string value, but a number value. what you have to do is then use randName and actually choose that variable from your array