The title of this question says it all, but I really don't know how to do this. I'm not going to share the userinputservice part of the script, but just the local function with what I've done. My selection system makes it so it doesn't detect if the chartwas already selected and some selected charts will repeat. Can anyone edit my script to make it so it doesn't select selected charts?

local function MoveLeft()
	local DetailChart = math.random(1, #Charts)
	local Choices = {}
	for i = 1,#Charts do
		if Charts[i]:IsA("Folder") then
			table.insert(Choices, Charts[i])
		end
	end
	local Chart = Choices[DetailChart]
	local Id = Chart.audio.SoundId
	GameChoiceMusic.SoundId = Id
	ChartTitle.Text = Chart.Name
	GameChoiceMusic.TimePosition = 50
	GameChoiceMusic:Play()
	SortScreen = false
	GameChoiceMusic.Volume = 0
	wait(0.25)
	SortScreen = true
	for i = 1,10 do
		GameChoiceMusic.Volume = GameChoiceMusic.Volume + 0.05
		wait()
	end
end

local function MoveRight()
	local DetailChart = math.random(1, #Charts)
	local Choices = {}
	for i = 1,#Charts do
		if Charts[i]:IsA("Folder") then
			table.insert(Choices, Charts[i])
		end
	end
	local Chart = Choices[DetailChart]
	local Id = Chart.audio.SoundId
	GameChoiceMusic.SoundId = Id
	ChartTitle.Text = Chart.Name
	GameChoiceMusic.TimePosition = 50
	GameChoiceMusic:Play()
	SortScreen = false
	GameChoiceMusic.Volume = 0
	wait(0.25)
	SortScreen = true
	for i = 1,10 do
		GameChoiceMusic.Volume = GameChoiceMusic.Volume + 0.05
		wait()
	end
end

Thanks!

4 comments

0

https://writingexplained.org/a-vs-an-difference also don't sign off your posts, your posts contain your username already. Also what do you expect "25 or 50" to do in " GameChoiceMusic.TimePosition = 25 or 50"? 

0

@programmerHere It's just a randomizer so the timeposition is always different, I'm sorry.

0

"25 or 50" isn't a randomizer. "25 or 50" ALWAYS evaluates to 25.

0

I didn't know.