So this script is just, not working.
It appears to me its correct but I cant find any error.
while true do
local songs = math.random(1,12)
if songs == 1 then
script.Music:FindFirstChild("1Alone"):Play()
end
if songs == 2 then
script.Music:FindFirstChild("2BuryAFriend"):Play()
end
if songs == 3 then
script.Music:FindFirstChild("3FUN"):Play()
end
if songs == 4 then
script.Music:FindFirstChild("4Happier"):Play()
end
if songs == 5 then
script.Music:FindFirstChild("5HeartAndSoul"):Play()
end
if songs == 6 then
script.Music:FindFirstChild("6Money"):Play()
end
if songs == 7 then
script.Music:FindFirstChild("7MyBoy"):Play()
end
if songs == 8 then
script.Music:FindFirstChild("8RainingTacos"):Play()
end
if songs == 9 then
script.Music:FindFirstChild("9SpookyScarySkeletons"):Play()
end
if songs == 10 then
script.Music:FindFirstChild("10ThankUNext"):Play()
end
if songs == 11 then
script.Music:FindFirstChild("11Thunder"):Play()
end
if songs == 12 then
script.Music:FindFirstChild("12WithoutMe"):Play()
end
print(math.random)
wait(20)
end
the script is inside the script service
Music is a folder inside the script
After FindFirstChild is an audio
Im trying to make random songs play
Im sure there are easier methods but I understand this one so please dont ask me to do an entirely different method oof.
At the end it says
print(math.random)
but then it prints something like this:
function: (random numbers and letters here)
I have no idea whats wrong

1 comment
because math.random is a function