I am trying to make a spinner and don't know how to get it to randomly select text.
For this, use math.random
wait(3) local a = math.random(1,3)
if a == 1 then script.Parent.Text = "1"
elseif a == 2 then script.Parent.Text = "2"
elseif a == 3 then script.Parent.Text = "3" end
Try this:
1 | local words = { separate,each,word,with,a,comma,test,word,bean } |
2 |
3 | -- spinner activate line here e.g script.Parent.MouseButton1Click:Connect(function() |
4 | local selectedword = math.random( 1 ,#words) |
5 | script.Parent.Text = words [ selectedword ] |
Try that