So I’m making this script for my game which automatically looks up an instance of a tool with the same name of a GUI element and changes the way the image inside of the GUI element appears accordingly through remotefunctions.
This appears to work completely fine, as the Explorer proves that the ID . However, inside of the GUI, the image turns completely white. Here’s what the gui looks like before and after the automatic runthrough:
And the scripts (which I’m almost 100% sure aren’t the problem):
Local Script
local replicatedStorage = game:GetService("ReplicatedStorage")
local Info = script.Parent.Parent.Parent:WaitForChild("Info")
local ItemImage = script.Parent.Parent.Parent:WaitForChild("Info").ItemImage
local ItemPrice = ItemImage.Parent.ItemPrice
local ItemName = ItemImage.Parent.ItemName
local ItemOwned = ItemImage.Parent.Owned
local ItemEquipped = ItemImage.Parent.Equipped
local BuyButton = ItemImage.Parent.Buy
local ValuePrice = ItemImage.Parent.Price
local ShopinRep = replicatedStorage:FindFirstChild(script.Parent.Parent.Parent.Name)
--
local player = game.Players.LocalPlayer
local BuyScript = BuyButton.Buy
local SelectedItem = script.Parent.Parent.Parent.SelectedItem
local BuyButton = ItemPrice.Parent.Buy
local ImageID = ShopinRep.GetImage:InvokeServer(script.Parent.Name) -- Get Image ID
script.Parent.Image = ImageID -- Apply Image ID
Server Script
local replicatedStorage = game:GetService("ReplicatedStorage")
local Name = script.Name
local Toolsbin = game:GetService("ServerStorage"):WaitForChild(Name)
local RSbin = replicatedStorage:WaitForChild(Name)
-- IMAGE
RSbin.GetImage.OnServerInvoke = function(player,item)
return Toolsbin[item].TextureId
end
So here’s a brief review of my problem:
- The script works completely fine and puts the image id into the GUI Image like it should
- The GUI Image “corrupts” and becomes white
What I would like to know is why the GUI Image is "corrupting and becoming white, and what I can do to fix.
MORE INFORMATION:
- I am using a similar script to this for what is essentially a carbon copy of this GUI, and it gets the images completely fine