I want to create a radio, which will pick random songs, and when they finish, it will return to the picking state.
Probloem is, it doesn′t return… How can I make it return?
local button = script.Parent
local function leftClick()
script.Parent.Parent.Parent.Namus.Text = "RockFM"
script.Parent.Parent.Parent.Pause.Text = "▮▮"
local random = math.random(1,7)
if random == 1 then
print("1Rock")
script.Parent.Parent.Parent.Sound.SoundId = "rbxassetid://14233703514"
script.Parent.Parent.Parent.Sound:Play()
wait(213.42)
print("returnd")
return
end
if random == 2 then
print("2Rock")
script.Parent.Parent.Parent.Sound.SoundId = "rbxassetid://14180233202"
script.Parent.Parent.Parent.Sound:Play()
wait(233.653)
print("returnd")
return
end
if random == 3 then
print("3Rock")
script.Parent.Parent.Parent.Sound.SoundId = "rbxassetid://14251338011"
script.Parent.Parent.Parent.Sound:Play()
wait(201.142)
print("returnd")
return
end
if random == 4 then
print("4Rock")
script.Parent.Parent.Parent.Sound.SoundId = "rbxassetid://14037889093"
script.Parent.Parent.Parent.Sound:Play()
wait(168.426)
print("returnd")
return
end
if random == 5 then
print("5Rock")
script.Parent.Parent.Parent.Sound.SoundId = "rbxassetid://13519287633"
script.Parent.Parent.Parent.Sound:Play()
wait(224.571)
print("returnd")
return
end
if random == 6 then
print("6Rock")
script.Parent.Parent.Parent.Sound.SoundId = "rbxassetid://13712572191"
script.Parent.Parent.Parent.Sound:Play()
wait(215.431)
print("returnd")
return
end
if random == 7 then
print("7Rock")
script.Parent.Parent.Parent.Sound.SoundId = "rbxassetid://13499683535"
script.Parent.Parent.Parent.Sound:Play()
wait(10) --This is the currently tested audio.
print("returnd")
return
end
end
button.MouseButton1Click:Connect(leftClick)