Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 3 years ago

im not asking for a script

0
You could make a table (array) of things it could say and pick a random one out of that. ElBamino 153 — 3y
0
You can use math.random(1, 4) MAD_DENISDAILY2 137 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago

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()
Ad

Answer this question