Hello, I have this script that is a mini-game script, its works but i am stuck on the part were it says pickmap=math.random i need help changing it to were it ask me which map comes first, right now it is choosing a random map from replicated-storage. I have 3 maps, there named map1,map2 and map3 what do i type to make it were it ask which map comes first.
here is the entire script just in case you need more details to help me.
local Players = game.Players:GetPlayers() for i = 1, #Players do Players[i].Playing.Value = true end
ChangeText('Game starting...') wait(2) GetMap() wait(1) ChangeText('Map Chose: ') wait(2) ChangeText('GameMode:TeamDeathMatch ') wait(2) local Players = game.Players:GetPlayers() for i = 1, #Players do if Players[i].Playing.Value == true and Players[i].isAFK.Value == false then local Spawn = game.Workspace.Map.Spawns.Spawn Players[i].Character.UpperTorso.CFrame = CFrame.new(Spawn.Position) local Sword = game.ReplicatedStorage.Sword Sword:Clone().Parent = Players[i].Backpack --[[local AllPlayers = game.Players:GetPlayers() for i = 1, #AllPlayers do local PickPlayer = math.random(1, #Maps) - - - - - - - - -- - - - - I am stuckhere local SelectedPlayer = AllPlayers[PickPlayer] print(SelectedPlayer.Name) local Sword = game.ReplicatedStorage.Sword Sword:Clone().Parent = game.Players:FindFirstChild(SelectedPlayer.Name).Backpack end]] Spawn:remove() Players[i].Character.Humanoid.WalkSpeed = 0 end end for i = 5, 0, -1 do ChangeText('Get READY! Starting in ' ..i) wait(1) end local Players = game.Players:GetPlayers() for i = 1, #Players do if Players[i].Playing.Value == true then Players[i].Character.Humanoid.WalkSpeed = 16 end end ChangeText('Deastory!') for i = GameTime, 0, -1 do ChangeText('Time until pay ' ..i) wait(1) end -- Awarding players local Players = game.Players:GetPlayers() for i = 1, #Players do if Players[i].Playing.Value == true then table.insert(Winners, Players[i].Name) Players[i].leaderstats.Money.Value = Players[i].leaderstats.Money.Value + 5 Players[i].leaderstats.Wins.Value = Players[i].leaderstats.Wins.Value + 1 Players[i].Character.Humanoid.Health = 0 Players[i].Playing.Value = false Players[i].PlayerGui.Main.MoneyShower.TextLabel.Visible = true end end RemoveMap() ChangeText('Thats it! GG!') wait(4)
end