I don't get any error, so a random map should be chosen, then when they touch any part of that map, they die, but it's not working and i don't get any error
--load map
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
for _, map in pairs(mapsParts) do
if map:IsA("BasePart") then
map.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
hit.Parent:BreakJoints()
end
end)
end
end
