How could i do a random Text from a table? help please, what am i doing wrong?
local Texts = {[script.Parent.HitsVar.Text] = "sd",[script.Parent.HitsVar.Text] = "kaka"}
math.random(Texts)
print(Texts)
How could i do a random Text from a table? help please, what am i doing wrong?
local Texts = {[script.Parent.HitsVar.Text] = "sd",[script.Parent.HitsVar.Text] = "kaka"}
math.random(Texts)
print(Texts)
You could do this:
local text = { -- array containing random text
"text1",
"hello world!"
}
local textLabel = -- text label here
textLabel.Text = text[math.random(1, #text)] -- change the text to something random in the array
Hm, if you needed to store a table inside a string, you would have to use HTTPService:JSONEncode() and JSONDecode()
Else @HugeCoolboy2007 works as it should;
Oh thanks you!! it works