What do you want to achieve? Keep it simple and clear!
I need when i click textbutton textlabel text become a mark, when i click again it unmark
What is the issue? Include screenshots / videos if possible!
idk but it’s don’t work
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
Idk why this didn’t work, but this must work
My code:
local Button = script.Parent
local TextMessage = "✅"
local Text = script.Parent.Parent
local debounce = true
Button.MouseButton1Click:Connect(function()
if debounce == true then
Text.Text = TextMessage
debounce = false
end
end)
Button.MouseButton1Click:Connect(function()
if debounce == false then
Text.Text = ""
debounce = true
end
end)
Like I said, I don’t know. The reason I said changing it could possibly be the fact that Text is a property, and the script might get confused with that. Besides that, I am unsure. Also, why’re you using a debounce to detect what state the text button is in?
But debounces are supposed to be used as a cooldown, not a variable to detect what state the textbutton is in. You could try using a different variable, but besides that, no clue why your script isn’t working.
Like I said, I don’t know why your script wouldn’t be working, everything else is fine. You could try maybe instead of having two mousebutton1click functions, just turn it into one with
Button.MouseButton1Click:Connect(function()
if debounce == true then
Text.Text = TextMessage
debounce = false
elseif debounce == false then
Text.Text == ""
debounce = true
end
end)
local Button = script.Parent
local TextMessage = "✅"
local Box = script.Parent.Parent
local debounce = false
local Marked = false
Button.MouseButton1Click:Connect(function()
if debounce == false then
debounce = true
if Marked == false then
Box.Text = TextMessage
Marked = true
else
Box.Text = ""
Marked = false
end
wait(0.5)
debounce = false
end
end)
Try This also i dont recommend using the same function twice in this situtation just check the text of it
Oh my bad didnt realise the topic is solved you better add solution checkmark or something lol