Trouble with Tables

I’m trying to make a project where you can generate a random mini tower with 1 - 30 floors, I’m trying to do a script where once the button is pressed it will get a random Adjective and Noun, but it won’t allow me to show the text, instead it shows me an error message, the message is “Attempting to concrete nil with nil.”.

could you send the last three lines of code so I can edit it?

the problem is with the math.random. You have to specify max. Ex:

math.random(1,4)

Change line 69 to this

Text.Text = "Tower of " .. TN1[math.random(#TN1)] .. TN2[math.random(#TN2)]

and because the script is from the server??

2 Likes

I know what the problem is…
I just wanted the last three lines because I don’t feel like typing it on mobile

I didnt mean to reply to you lol, I meant to reply to the topic

not sure if you can do this with one argument like that?

but I would do

math.random(1, #TN1)

It is valid, 1 is automatically placed when it only has one argument.

Thank you guys so much for the help!

1 Like

thanks, never knew that

I personally still like it with two arguments more, that’s an opinion though

EDIT: the screenshot wasn’t really needed, I guess it might help other people

1 Like