So I have a character select GUI and it fires a event and changes the character model I also want the GUI image to change. This is what I have so far.
1 | local event = game.ReplicatedStorage [ "Choose Goku (S:2)" ] |
2 |
3 | event.OnServerEvent:Connect( function () |
4 | script.Parent.Image = "rbxgameasset://Images/Goku Icon" |
5 | end ) |
So I want the image to change after I receive that the event has fired.
I am new too scripting so any help would be great, thank you.
I have two solutions for this.
First one:
At this line you have to write the id of the image, not the name:
1 | script.Parent.Image = "rbxgameasset://Images/Goku Icon" |
I can't really help you with the Id, since there are many with the same name. :/
You would probably also have to reload the frame.
Hope this helped you understand roblox asset Id. :)
Second:
You can have another image, and then turn of the visibility of the other and turn on for that image.
1 | script.Parent.Image 1. Visibility = false -- Since it's a bool value. |
2 |
3 | script.Parent.Image 2. Visibility = true -- Other Image. |
Hope one of these helped you. - Toby