Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

math.random isn't working for script, keeps choosing specifically? [closed]

Asked by 6 years ago

This question already has an answer here:

having math.random() Issue? SOLVED!

I'm trying to make a script that will randomly select a song. RANDOMLY. The script keeps on choosing it in order. here's the script:

local Sound1 = script.Lucid
local Sound2 = script.DankTrain
local Sound3 = script.LikeItLikeThat

wait()math.random(1,3)

if 1 then
    print("Lucid")
    Sound1:Play()
    wait(88)
    Sound1:Stop()
end
if 2 then
    print("")
    Sound2:Play()
    wait()
    Sound2:Stop()
end

if 3 then
    print("LikeItLikeThat")
    Sound3:Play()
    Sound3.PlaybackSpeed = 0.9
    wait(257)
    Sound2:Stop()
end



Marked as Duplicate by RayCurse and DanzLua

This question has been asked before, and already has an answer. If those answers do not fully address your question, then please ask a new question here.

Why was this question closed?