When I try removing the ChosenSong and FakeChosenSong values they print as nil but are used multiple times and they print at the bottom normally. So they don't actually get removed and im not sure what is causing this.
Output GIF: https://gyazo.com/970ecb14b8aa72e84e72ec97010b14ff
songs = {461736208,438917260,516046263,506212392}
boards = workspace.Boards
while true do
chosensong = songs[math.random(1,#songs)] --Choses a random ID from songs list
chosenboard = math.random(1,4) --Selects random board
for i = 1,4 do
if i == chosenboard then
local songname = game:GetService("MarketplaceService"):GetProductInfo(chosensong) --Gets the asset name from ID
boards:FindFirstChild("Board"..i):WaitForChild("SurfaceGui"):WaitForChild("SongChoice").Text = tostring(songname.Name) --Places chosen song on boards
table.remove(songs, chosensong)
print(songs[chosensong])
else
local chosenfakesong = math.random(1,#songs)
local chosenfakesong = songs[chosenfakesong]
local songname = game:GetService("MarketplaceService"):GetProductInfo(chosenfakesong) --Gets the asset name from ID
boards:FindFirstChild("Board"..i):WaitForChild("SurfaceGui"):WaitForChild("SongChoice").Text = tostring(songname.Name) --Places chosen song on boards
table.remove(songs, chosenfakesong)
print(songs[chosenfakesong])
end
end
wait(1)
for i = 1,#songs do
print(songs[i])
end
wait(1)
end

1 comment
Thanks!