local words = {"If I could see you, I would give you a great big hug!";
"You are a great person";
"You are amazing";
"I know you can do anythig";
"You are super smart";
"Tell me more"
}
script.Parent.Activated:Connect(function()
print{words [math.random(#words)]}
script.Parent.Text = {words[math.random(#words)]}
end)
script is meant to be to give random sentences when you click on the button.
local words = {"If I could see you, I would give you a great big hug!";
"You are a great person";
"You are amazing";
"I know you can do anythig";
"You are super smart";
"Tell me more"
}
script.Parent.Activated:Connect(function()
print(words[math.random(1, #words)])
script.Parent.Text = words[math.random(1, #words)]
end)
What I fixed - you don’t need the table brackets for a string. Additionally, added the 1 argument to the math.random function, as you should have a starting value for this function.
local words = {"If I could see you, I would give you a great big hug!";
"You are a great person";
"You are amazing";
"I know you can do anythig";
"You are super smart";
"Tell me more"
}
script.Parent.Activated:Connect(function()
print({words [math.random(#words)]})
script.Parent.Text = words[math.random(#words)]
end)
When you’re printing, you have to put the provided items in “()”
Plus, the second error was that you tried to put a table as the text.