I was working on a bigger problem and i noticed that my script was having problems changing a imagelabel.Image and also the text on a text label wouldnt change. I tried it out on a simplified version by just clicking a text button the gui imagelabel.Image would change but it isnt. I tried multiple ways of changing the image id from rbxassetid://862865537 to just 862865537 but it doesnt work. I know it is simple coding but i am just stumped on why its not working.
player = game.Players.LocalPlayer local idi = "rbxassetid://862865537" local slots = game.StarterGui.backpackgui.mainframe.Frameright script.Parent.MouseButton1Click:Connect(function() slots.slot1.ImageLabel.Image = idi print("clicked") end)
Wrong --> local slots = game.StarterGui.backpackgui.mainframe.Frameright
local player = game.Players.LocalPlayer local idi = "rbxassetid://862865537" local slots = player.PlayerGui.backpackgui.mainframe.Frameright script.Parent.MouseButton1Click:Connect(function() slots.slot1.ImageLabel.Image = idi print("clicked") end)
Wrong image format....
local idi = "rbxasset://textures/ui/yourimage.png"
Note* It doesn't have to be PNG just needs to have the end of the file type.
Hope That Helped.
Still can't figure it out. Can you not change an imagelabel in the startergui with a simple localscript with filteringenabled? I have looked this up and many different time periods up to five years seem to be different like one is http://www.roblox.com/asset/?id3456436 or rbxgameasset://284402785" but none seem to work.
Simply you can't use StarterGui in order to change any property of a GUI in game. When you start a game it copies all the assets from the Starter Gui inside a player so you have to use PlayerGui from Player instance and if you are using a local script, the best way to do it is game:GetService("Players").LocalPlayer.PlayerGui