Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I make the image label change images when a text button is clicked?

Asked by 4 years ago
Edited 4 years ago
local ANA = script.Parent
local Event = game:GetService("ReplicatedStorage").GameEvents.ScoreboardControl.AwayChanger

ANA.MouseButton1Click:Connect(function()
    game.StarterGui.TeamChoose.Frame.HT.HLogo.Image = "rbxassetid://".."4655259878"


end)

1 answer

Log in to vote
0
Answered by 4 years ago

StarterGui is actually not the player’s GUI. StarterGui is what’s replicated into the player’s PlayerGui, this is the actual GUI. You can make it change in the player’s playergui in two ways.

The first way is by getting it from the player.

game.Players.LocalPlayer.PlayerGui.TeamChoose.Frame.HT.HLogo.Image = "rbxassetid://".."4655259878"

The second way is by using script.Parent (Change it to how it's actually like)

script.Parent.Parent.TeamChoose.Frame.HT.HLogo.Image = "rbxassetid://".."4655259878"
0
Thanks! Patriq_Kane 8 — 4y
Ad

Answer this question