In a game, I want to make a script that chooses three maps and puts it in a random order So far this is my script bu the problem is it doesn't make each map in a random order or a random choosing:

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Intermission = ReplicatedStorage.Stages.Intermission
local Voting = ReplicatedStorage.Stages.Voting
local InGame = ReplicatedStorage.Stages.InGame
local Map1Votes = ReplicatedStorage.MapsChosen.Map1
local Map2Votes = ReplicatedStorage.MapsChosen.Map2
local Map3Votes = ReplicatedStorage.MapsChosen.Map3
local highest = 0
local MapRandomOrder = {Map1Votes.Value, Map2Votes.Value, Map3Votes.Value}

while true do
	wait()
	--//Check
	Intermission.Value = false
	Voting.Value = false
	InGame.Value = false
	
	--//Main Events
	Intermission.Value = true
	wait(1)
	Intermission.Value = false
	Voting.Value = true
	for _, MapName in pairs(game.ReplicatedStorage.MapsNames:GetChildren()) do
		wait()
		if MapName.MapChosenLastRound.Value == false then
			for _, MapChosen in pairs(game.ReplicatedStorage.MapsChosen:GetChildren()) do
			 if MapChosen.Taken.Value == false then
				if MapName.Chosen.Value == false then
				MapChosen.Value = MapName.Value
				MapChosen.Taken.Value = true
				MapName.Chosen.Value = true
				end
			end
		end
	end
end
end

2 comments

0

Do you want voting or just random 3 maps?

0

It’s fine I already found a way.