I'm trying to make a dialogue box that appears then starts talking but for some reason its not changing the text of the text label
local mouse = game.Players.LocalPlayer:GetMouse() local txt = game.Players.LocalPlayer.PlayerGui.ScreenGui.Frame.TextLabel.Text mouse.Button1Down:Connect(function() print("Mouse1Down") if mouse.Target.Name == "Hitbox" then print("Mouse1Down2") game.Players.LocalPlayer.PlayerGui.ScreenGui.Frame.Visible = true txt = "Thank you so much for everything you have done dad!" wait(13) txt = "Happy Fathers Day! We really care about you!" wait(10) txt = "Thank you so much for raising us and being such a good parent!" wait(10) txt = " - Name" wait(5) game.Players.LocalPlayer.PlayerGui.ScreenGui.Frame.Visible = false else print("False") print("Target is " .. mouse.Target.Name) end end)
I think you are using the variable wrong, instead of doing local txt = game.Players.LocalPlayer.PlayerGui.ScreenGui.Frame.TextLabel.Text
You should set it to only
local txt = game.Players.LocalPlayer.PlayerGui.ScreenGui.Frame.TextLabel
So try this one, I corrected the script
local mouse = game.Players.LocalPlayer:GetMouse() local txt = game.Players.LocalPlayer.PlayerGui.ScreenGui.Frame.TextLabel mouse.Button1Down:Connect(function() print("Mouse1Down") if mouse.Target.Name == "Hitbox" then print("Mouse1Down2") game.Players.LocalPlayer.PlayerGui.ScreenGui.Frame.Visible = true txt.Text = "Thank you so much for everything you have done dad!" wait(13) txt.Text = "Happy Fathers Day! We really care about you!" wait(10) txt.Text = "Thank you so much for raising us and being such a good parent!" wait(10) txt.Text = " - Name" wait(5) game.Players.LocalPlayer.PlayerGui.ScreenGui.Frame.Visible = false else print("False") print("Target is " .. mouse.Target.Name) end end)