Why can't I set the TextButton's image?

Hello friends, so recently I’ve tried setting a TextButton’s image, as you can see by this post, it didn’t. If you could help me out that would be awesome! :heart:

Errors: nil

LocalScript:

local Image = script.Parent.Image
Image = "rbxassetid://6027287125"
1 Like

you need to do Image.Image = "rbxassetid://6027287125"

by saying Image = id you basically change the variable not the property of the image object

TextButtons do not have an image property. and like @NyrionDev said you are changing what the variable is defining. If you want to change the image you would do this.

local imageLabel = path_to_instance
imageLabel.Image = "rbxassetid://6027287125"

as @NyrionDev said, you need to set as a variable the script parent, not the property

put this instead:

local UI = script.Parent
UI.Image = "rbxassetid://6027287125"

Also, i think you mean a ImageButton instead of a TextButton, right?

Are you using ID? You should be using its irl