Hi, I have a problem changing my textlabel's text. This is my current script
local Button = script.Parent local Label = game.StarterGui.ScoreboardGui.Scoreboard.Main.Home.Main.TeamName Button.MouseButton1Click:Connect(function() Label.Text = "hi" end)
Hope there is a way you can help me, thanks!
script.Parent.MouseButton1Click:Connect(function() script.Parent.Text = "Example Text" end)
This is a really easy and simple question. I can't see any mistakes on your script since you haven't posted it in proper code format. Make sure that the script is alocal script
..
Solution
local Button = script.Parent -- Define the Textbutton local Label = game.StarterGui.ScoreboardGui.Scoreboard.Main.Home.Main.TeamName Button.MouseButton1Click:Connect(function() label.Text = "Hi" -- Change Hello to what you want the text to be.. end)
Example 2
local Button = script.Parent -- Define the Textbutton local Label = game.StarterGui.ScoreboardGui.Scoreboard.Main.Home.Main.TeamName Button.MouseButton1Click:Connect(function() label.Text = "This is a local script" -- -- Change **This is a local script** to what you want the text to be.. wait(2) label.Text = "Hello" -- Change **Hello** to your own text if you would like to.. end)
Example 3
local Button = script.Parent -- Define the Textbutton local label = game.StarterGui.ScoreboardGui.Scoreboard.Main.Home.Main.TeamName Button.MouseButton1Click:Connect(function() label.Text = "Hello" label.TextColor3 = Color3.new(255,0,0) -- 255,0,0 is a red color.. end)
I hope this helps you and please up vote and select this as your answer if it did so..