I am trying to print out the name of the value that has been selected by math.random(), I have a folder inside ReplicatedStorage which holds all the available power-ups, the error that I am receiving is:
Workspace.CoreScript:68: attempt to index number with 'Name'
The script:
local powerUps = game.ReplicatedStorage.PowerUps:GetChildren()
local ranPowerUp = math.random(1, #powerUps)
if ranPowerUp.Name == "Speed" then
print("Speed power-up has been selected!")
end

3 comments
Thank you, it worked!
math.random() will not change the internal seed; making calls will not adjust the "randomness".
Internally i know this, but it FEELS more random. Which makes it true.