trying to make a random map select but i keep geting this error "ServerScriptService.MainScript:39: attempt to get length of a number value - Server - MainScript:39"
local AvailableMaps = mapsFolder:GetChildren()
local ChosenMap = AvailableMaps[math.ramdom(1,#2)]
Status.Value = ChosenMap.Name.." Chosen"
local ClonedMap = ChosenMap:Clone()
ClonedMap.Parent = workspace
this dosnt work
local AvailableMaps = mapsFolder:GetChildren()
local ChosenMap = AvailableMaps[math.ramdom(1,#AvailableMaps)]
Status.Value = ChosenMap.Name.." Chosen"
local ClonedMap = ChosenMap:Clone()
ClonedMap.Parent = workspace
and this give me "ServerScriptService.MainScript:39: attempt to call a nil value - Server - MainScript:39"
any help or suggestions would be greatly apresiated
also 39 would be line 2 in this
sorry for spelling and formating

1 comment
It's math.random not math.ramdom. Secondly, you cannot do #n only #table because numbers are not tables.