so i have this minigame and i dont know how to properly remove the destroyed tiles out of an array. i also need help with resetting the minigame once a round is over
script:
Pads = script.Parent.Pads:GetChildren()
padarray = {}
while script.Parent.Parent == game.Workspace do
wait(0,2)
ranpad1 = math.random(1, #Pads)
ranpad2 = math.random(1, #Pads)
ranpadchoosen = Pads[ranpad1]
ranpadchoosen2 = Pads[ranpad2]
wait(2)
for i = 0, 1, 0.05 do
ranpadchoosen.Transparency = i
ranpadchoosen2.Transparency = i
wait(0,2)
end
ranpadchoosen:Destroy()
ranpadchoosen2:Destroy()
end
Instead of destroying the pads just set it so player’s can’t collide with them. Thus when the round is over you just need to loop through the pads and reset their properties to be reused.