Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Textlabel not changing when the textbutton is activated?

Asked by 4 years ago

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

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

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.

0
Oh whoops I didnt notice that error. I changed it and yet still the same problem yayimstrongforever 0 — 4y
Ad
Log in to vote
0
Answered by 4 years ago

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)
0
I remember trying something similar to that as well, yet it still didnt work. yayimstrongforever 0 — 4y
0
for me, this worked, so i dont know whats up with yours jdm4llfem8 94 — 4y
0
I think at this point it may be a glitch, I tried everything I could and it still didnt work yayimstrongforever 0 — 4y
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? yayimstrongforever 0 — 4y

Answer this question