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

local ChosenMap = AvaliableMaps [math.random(1, #AvaliableMaps)] not working. How do I fix this?

I'm making a swordfight game on roblox currently. This line of code is giving me an error saying:

" ServerScriptService.MainScript:39: attempt to get length of a nil value - Server - MainScript:39 "

local ChosenMap = AvaliableMaps [math.random(1, #AvaliableMaps)]

I have looked through other problems like this and have still not found the answer.

Any help is appreciated.

Thanks!

2 comments

0

Can you provide the script to me?

0

use WaitForChild instead of FindFirstChild when defining AvailableMaps

1 answer

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