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

What will make this text button change texts?

I need it so that when the player clicks the text button, the text of it goes from "High", to "Low" and this script isn't working. There is a blue line under the word "Low". I am new to scripting and still learning so try to make it understandable for a newbie :D

script.Parent.MouseButton1Down:connect(function()
	script.Parent.Text = Low
end)

1 comment

0

LocalScript

1 answer

The reason the text isn't changing is because you are giving it a variable to change to, you want to change it to a string

script.Parent.MouseButton1Down:connect(function()
    script.Parent.Text = "Low"
end)

Strings are made using " " or ' '

You can create a variable with a string value then use it to change the text of the button

local text = "Low"
script.Parent.MouseButton1Down:connect(function()
    script.Parent.Text = text
end)

2 comments

0

So I make the Value in the StringValue Low? Or change the name of the StringValue to Low? Im confused never use Strings before

0

@DarkAssasin0 which ever makes you more comfortable, if its not always going to be "Low" then make a variable that you can change later

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