Explanation
This is a really easy and simple question. Make sure that the script is a local script else this script won't work and can possibly bring errors..
Solution
local Button = script.Parent
local Label = game.StarterGui.ScoreboardGui.Scoreboard.Main.Home.Main.TeamName
Button.MouseButton1Click:Connect(function()
label.Text = "Hi"
end)
Example 2
local Button = script.Parent
local Label = game.StarterGui.ScoreboardGui.Scoreboard.Main.Home.Main.TeamName
Button.MouseButton1Click:Connect(function()
label.Text = "This is a local script"
wait(2)
label.Text = "Hello"
end)
I also recommend you adding variables..
Example 3
local Button = script.Parent
local label = game.StarterGui.ScoreboardGui.Scoreboard.Main.Home.Main.TeamName
Button.MouseButton1Click:Connect(function()
label.Text = "Hello"
label.TextColor3 = Color3.new(255,0,0)
end)
I hope this helps you and please up vote and select this as your answer if it did so..
3 comments
Is label the name of the textlabel?
yes
it's a variable