Text wont change when clicked

  1. What do you want to achieve? I want to make it so whenever you press the TextButton it changes the text of the TextButton.

  2. What is the issue? When I click the button it does nothing, doesn’t change.

  3. What solutions have you tried so far? I tried everything and looked everywhere nothing works.

s.MouseButton1Click:Connect(function(click)
	if click then
		s.Text = "-"
	end	
end)

Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.

Remove the click argument. MouseButton1Click has no arguments.

1 Like

I know I tried that, still doesnt work

s.MouseButton1Click:Connect(function()
	s.Text = "-"
end)

Sorry, it does work BUT if I cant figure out how to make it so like you press it once, it says something, you press it again it says something else

I know, but how would I make it so whenever you click it changes to a different text?

You may want to consider using a debounce.

actually do

script.MouseButton1Click:Connect(function()

script.Parent.Text = “_” – your text

)

btw, the script.Parent is your textlabel you’re trynna change

s.MouseButton1Click:Connect(function()
s.Text = tostring('Text here')
end)

Try that make sure its in a local script.

Im making a calculator so I want to be able to click the sign and for it to change like you click and its - click again and its /

@N_aps Can you try this?

(Isjsjsjsn)

What does that do? All im trying to do is make it so each time yoou press it changes text

local db = true
— This should work
s.MouseButton1Click:Connect(function()
if db == true then
s.Text = tostring("-")
db = false
else
s.Text = tostring("/")
end
end)
1 Like

Also another thing, I don’t know if I’m supposed to make a new topic for this but, whenever I’m scripting and I try to make more than one else/elseif it doesn’t work, nothing in output either.