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

Textlabel not changing when the textbutton is activated?

So I'm trying to make some sort of dialog for my game. I'm trying to make a textbutton change the text of the textlabel.

local button = script.Parent
local main = game.StarterGui.ScreenGui.Frame.MainDIalogue.Text

local function onClicked()
	main = "something something"
	
end

button.Activated:Connect(onClicked)

However, when I try clicking on the textbutton. Literally nothing happens, no error, no change. Just nothing. Did I reference something wrong or probably I have it in the wrong order? Im using a local script for this by the way.

2 answers

Is it meant to say "MainDIalougue" and not "MainDialougue", There is a capital i that i don't think should be there unless you added it on purpose. Its case sensitive.

1 comment

0

Oh whoops I didnt notice that error. I changed it and yet still the same problem

I found the fix when i was testing, you have to make the variable not say text then add text onto the function

local button = script.Parent
local main = game.StarterGui.ScreenGui.Frame.MainDIalogue

local function onClicked()
	main.Text = "something something"
	
end

button.Activated:Connect(onClicked)

4 comments

0

I remember trying something similar to that as well, yet it still didnt work.

0

for me, this worked, so i dont know whats up with yours

0

I think at this point it may be a glitch, I tried everything I could and it still didnt work

0

So I realized with the new bubble chat, roblox dialog works perfectly without cutting off sentences or words. So I decided to just use that instead, should I mark this as answered?

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