Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Why won't the image change? [Solved]

When I click the TextButton, the ImageLabel won't change!

button = script.Parent.Parent.Parent.Parent.ScreenGui.Frame.ImageButton
text = script.Parent.Parent.Parent.Parent.ScreenGui.Frame.TextLabel
local chats = {
	"Hello"; 
	"Hi";
}
function Click()
button.Image = "rbxassetid://271666611"
text.Text = chats[math.random(1, #chats)]
end

I forgot a a line in the script

1 answer

✓ Accepted answer

Currently, you've not called the function named "Click", it's only be defined.

To get the image to change, you need to place the code button.MouseButton1Down:connect(Click)on line 11.

This will call the function whenever the button is clicked.

This discussion is preserved as it was. New answers, comments, and votes are closed.