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.
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.
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)