Hello, I’m trying to learn how to use math.random() efficiently and I made som challenges for myself. I made a button that when clicked; Should select a random function to call. Here is the code I tried, but it didn’t work unfortunately.
detector.MouseClick:Connect(function(plr)
local tablet = {death(), meteor()}
if cooldown == false then
btn.Color = Color3.fromRGB(145, 0, 2)
cooldown = true
btn.CFrame = CFrame.new(-17.35, 4.4, 0.1)
math.random(0,#tablet)
wait(3)
cooldown = false
btn.Color = Color3.fromRGB(255, 0, 0)
btn.CFrame = CFrame.new(-17.35, 4.8, 0.1)
elseif cooldown == true then
warn("Please Wait!")
return end
end)