#how do I button that changes a text label on a board when pressed
59 messages · Page 1 of 1 (latest)
script.Parent.MouseButton1Up:Connect(function()
script.Parent.Text = "Clicked!"
end)
LocalScript parented to your Text Button
so you want it to be random or
alright so
put a script into the button and a click detector
Now create a table for all the possible messages
local messages = {
“hello”,
“bye”
}
replace hello and bye with your messages
make sure to add commas
add a comma in the previous one, then write a new one
“hello”,
“bye”,
“good morning”,
“good night”,
alright so
make a variable for your text
local text = {
"Clicked1",
"Clicked2"
}
script.Parent.MouseButton1Up:Connect(function()
local randomtext = text[math.random(1,#text)]
script.Parent.Text = randomtext
end)
parent to your textbutton
where is the script parented
alright so
local textlabel = script.Parent
local text = { -- Table of strings, all should contain a comma at the end except for the last one
"Clicked1",
"Clicked2"
}
script.Parent.MouseButton1Up:Connect(function() -- Fired when you left click the button
local randomtext = text[math.random(1,#text)] -- Selects a random string from your text table
script.Parent.Text = randomtext -- Sets the text
end)
uhh sure give me a second to write it in on my phone
alr there you go
ooh creepy size
thanks zxro
💀💀💀💀💀
😭😭
and make sure it has no viruses
when I get on my pc I will show you how
The text, right now Button will change into Clicked1 or Clicked2
if you spam click it you will see how it sort of "rotates" through each string
plates?
like 20 more buttons
i mean its not that hard
what the fuck

what kind of game
are you making
its implying that you pickedi t
** You are now Level 8! **
oh my god
sure
alr
man are you tryna ban me

im just gonna act like i lost this forum post 👍
