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
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)
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..
6 comments
the parent is a button right? If so, look at my answer.
yes, the parent is the button
did my answer work?
No, the button didn't do anything
let me rephrase my question if it helps. Is the parent of script a TextButton? And is it a local script or a script?
I accidentally posted two. This is my first time on the website