Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

how would i make a sign where it has a random text everytime u equip it?

im not asking for a script

2 comments

0

You could make a table (array) of things it could say and pick a random one out of that.

0

You can use math.random(1, 4)

1 answer

Well, here's what you can do:

-- Firstly, Create a table containing all the texts you want to appear
Texts = {
"I saw a cat",
"Cats are amazing",
"I saw epic doggo",
"Spongebob"
}

local Textlabel = _________ --Refer to the Textlabel you want it to appear

function SelectRandomText()
	--This will select a random text from the table
	local RandomSelectedText = math.random(1,#Texts)
	return RandomSelectedText
end

Textlabel.Text = SelectRandomText()
--This will select a random text everytime you say SelectRandomText()

This discussion is preserved as it was. New answers, comments, and votes are closed.