So Basically, when a random map is chosen, and if players touch on it, they are supposed to die, but it's not working, Error: ServerScriptService.Main:27: attempt to call a nil value
local mapsStorage = game.ServerStorage.Maps:GetChildren()
local randomMapChoser = mapsStorage[math.random(1, #mapsStorage)]
print("The Random map is: "..randomMapChoser.Name)
local randomMapClone = randomMapChoser:Clone()
randomMapClone.Parent = workspace.currentMap
-- kill players when touch map
local mapsParts = mapsStorage:GetChildren()
mapsParts.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
hit.Parent.Character.Humanoid.Health = 0
end
end)

2 comments
ServerScriptService.Main:27: attempt to call a nil value, on this line : local mapsParts = mapsStorage:GetChildren()
Edited my script. Should work now. The issue was you were getting a table from a table.