Image wont update through server script

Hello everyone, i am having a bit of a problem. When i try to set my imagelabel’s image, it does not set. When i go in game and go into my playergui and check the image, it is blank their too. I am trying to change the image through server script. I tried “rbxassetid://”, “rbxthumb://type=Asset&id=(RandomAssetIdHere)&w=420&h=420” and even getting the actual id from pasting it into a image label and taking it out again. I cant seem to find the reason why this wont work. Their is no other script that changes the image label back either, and the code works 100% fine.

Code

https://gyazo.com/22f03effe4c6cf6a7520760ce7feb3a7

Script that prints image changed

https://gyazo.com/81cb6f466f8b64d611cd8b3c76faaa8f

Output of that script

https://gyazo.com/359d3fbce0aedf11ae11429e1ed0cc43

Image after click

https://gyazo.com/e25c779812044494b305b04b578f6a44

um… your title says server script??? you have to use localscript for stuff like this

you cant do it in server? ah thats a bummer alright thank you ill try in local

Also if u send the full script I can fix it if it doesnt work.

New problem, only one of them set the image, i have 4 diffrent items with four diffrent rarities. I dont know why only one would considering the rest of the code works for the others. Its like for those 3 the script just skips over that line. Only thing diffrent about these items are the names and that doesnt matter since they all change a value, and when that value is changed this code executes:

Gearequiped.Changed:Connect(function()
		
		Gear.Image = "rbxthumb://type=Asset&id=6435589354&w=420&h=420"

	if Gearequiped.Value == item.Name then
		equip.BackgroundColor3 = Color3.fromHSV(0, 1, 1)
		
		equip.Text = "Unequip"
		
	else
		
		Gear.Image = ""
		
		equip.BackgroundColor3 = Color3.fromRGB(11, 255, 60)
		equip.Text = "Equip"
		
	end
	
	equipsound:Play()
	
end)

so yea i dont know why it skips over the image for uncommon rarity +

can you make your script smaller lol i cant read it

yea sorry ill remove some spaces and such

try changing that line to
Gear.Image = 0

i tried, it does not seem to be working

I think it has something t do with using rgb and hsv to chang eht colors idk cuz ive never tried it before

The rgb background change is only for the equip / unequip effect. When its equipped its red and says unequip, and when its not equipped its green and says equip

The colors should both be from the RBG color:

  1. Change color type to Color3.FromRGB

Thats the thing, the colors are working fine ( i changed it to rgb, still the same thing) everything is working fine. The script it self runs, heck, i have a print script to print when it changes and it does print, its just it only shows when i click on a common item. Which is weird since the only diffrence between them is the name, and any diffrences shouldnt matter since they are using the same script in each and every one of them and they are updating the same value. The value changes then the item that changed the value now gets unequip and red text and heck it even equips the item. It just seems like every other item besides the common one (one in grey) skips over that line and ONLY that line of code, yet it still detects change and prints it

Maybe you have ImageTransparency on?
On is 1.
If it is in 1 change to 0.

yea its on 0, it works. Just only works for the common one

If there is spaces on the items names it’s won’t work. @Daark3nd

if this is hard to understand, its like i have 4 diffrent click detections. They each have a local script inside of them that says

Value.Changed:Connect:Function()
“print(“Hi”)
print(“Hello”)
print(“Bye”)”
end)

when clicked each of them change the value and the script detects that. The problem is, the first one when clicked prints hi hello and bye just fine. The rest of them only prints hi and bye, and skips over Hello like it couldnt read it.

ill share my script

Item Handler (Server)

game.Lighting.GUIRemotes.ItemGiver.OnServerEvent:Connect(function(player,Item,equipped)
	local character = player.Character
	
	local GearEquiped = player.Inventory.Gear.Equiped
	local gearequiped = game.ReplicatedStorage.InventoryGui.GearIsEquiped
		
		
	--------------------------------------------------------SludgeHead------------------------------------------------------------
		
	if Item == "CSludgeHead" then
		
		local itemid = player.Name .. Item		
		
		if GearEquiped.Value == false then	
			
			GearEquiped.Value = true
			gearequiped.Value = Item
			
			itemequiped[itemid] = true
			
		local SludgeHead = serverstorage:FindFirstChild("Gear").Gear.SludgeHead:Clone()
		SludgeHead.Anchored = false
		SludgeHead.Parent = character

		SludgeHead.CFrame = (CFrame.new(character.Head.Position,character.Head.Position + -character.Head.CFrame.LookVector))
		local weld = Instance.new("Motor6D")
		weld.Part0 = SludgeHead
		weld.Part1 = character.Head
		weld.C0 = weld.Part0.CFrame:toObjectSpace(weld.Part1.CFrame)		
		weld.Parent = SludgeHead
		weld.Name = "Head"	
			
		StatBoost(player,250)			
			
		else
			
			if itemequiped[itemid] == true then
			
			GearEquiped.Value = false
			gearequiped.Value = "None"

				if player.Character:FindFirstChild("SludgeHead") then	
					player.Character:FindFirstChild("SludgeHead"):Destroy()
				end	
				
			StatBoost(player,-250)	
				
				
				itemequiped[itemid] = false
				
			end		
		end
		
	elseif Item == "USludgeHead" then
		
		local itemid = player.Name .. Item
		
		if GearEquiped.Value == false then	
			
			itemequiped[itemid] = true
			
			GearEquiped.Value = true
			gearequiped.Value = Item
			
			local SludgeHead = serverstorage:FindFirstChild("Gear").Gear.SludgeHead:Clone()
			SludgeHead.Anchored = false
			SludgeHead.Parent = character

			SludgeHead.CFrame = (CFrame.new(character.Head.Position,character.Head.Position + -character.Head.CFrame.LookVector))
			local weld = Instance.new("Motor6D")
			weld.Part0 = SludgeHead
			weld.Part1 = character.Head
			weld.C0 = weld.Part0.CFrame:toObjectSpace(weld.Part1.CFrame)		
			weld.Parent = SludgeHead
			weld.Name = "Head"	

			StatBoost(player,332)			

		else
			
			if itemequiped[itemid] == true then
			
			GearEquiped.Value = false
			gearequiped.Value = "None"
				
			if player.Character:FindFirstChild("SludgeHead") then	
			player.Character:FindFirstChild("SludgeHead"):Destroy()
			end	
					
					StatBoost(player,-332)	
					
				
				itemequiped[itemid] = false

			end		
				
		end
		
	elseif Item == "RSludgeHead" then

		local itemid = player.Name .. Item

		if GearEquiped.Value == false then	

			itemequiped[itemid] = true

			GearEquiped.Value = true
			gearequiped.Value = Item

			local SludgeHead = serverstorage:FindFirstChild("Gear").Gear.SludgeHead:Clone()
			SludgeHead.Anchored = false
			SludgeHead.Parent = character

			SludgeHead.CFrame = (CFrame.new(character.Head.Position,character.Head.Position + -character.Head.CFrame.LookVector))
			local weld = Instance.new("Motor6D")
			weld.Part0 = SludgeHead
			weld.Part1 = character.Head
			weld.C0 = weld.Part0.CFrame:toObjectSpace(weld.Part1.CFrame)		
			weld.Parent = SludgeHead
			weld.Name = "Head"	

			StatBoost(player,415)			

		else

			if itemequiped[itemid] == true then

				GearEquiped.Value = false
				gearequiped.Value = "None"

				if player.Character:FindFirstChild("SludgeHead") then	
					player.Character:FindFirstChild("SludgeHead"):Destroy()
				end	
				StatBoost(player,-415)	

				itemequiped[itemid] = false

			end		

		end
		
	elseif Item == "PSludgeHead" then

		local itemid = player.Name .. Item

		if GearEquiped.Value == false then	

			itemequiped[itemid] = true

			GearEquiped.Value = true
			gearequiped.Value = Item

			local SludgeHead = serverstorage:FindFirstChild("Gear").Gear.SludgeHead:Clone()
			SludgeHead.Anchored = false
			SludgeHead.Parent = character

			SludgeHead.CFrame = (CFrame.new(character.Head.Position,character.Head.Position + -character.Head.CFrame.LookVector))
			local weld = Instance.new("Motor6D")
			weld.Part0 = SludgeHead
			weld.Part1 = character.Head
			weld.C0 = weld.Part0.CFrame:toObjectSpace(weld.Part1.CFrame)		
			weld.Parent = SludgeHead
			weld.Name = "Head"	

			StatBoost(player,500)			

		else

			if itemequiped[itemid] == true then

				GearEquiped.Value = false
				gearequiped.Value = "None"

				if player.Character:FindFirstChild("SludgeHead") then	
					player.Character:FindFirstChild("SludgeHead"):Destroy()
				end	
				StatBoost(player,-500)	

				itemequiped[itemid] = false

			end		

		end
		
	end	
end)

I am not sure what is the solution.

Item Handler (Local)

local player = game.Players.LocalPlayer
local equip = script.Parent
local item = script.Parent.Parent

local weapon = false

local animations = script:WaitForChild("Animations")

local katanaAnim = animations:WaitForChild("KatanaIdle")

local Humanoid = player.Character:WaitForChild("Humanoid")

local KatanaIdle = Humanoid:LoadAnimation(katanaAnim)

local Weapon = script.Parent.Parent.Parent.Parent.Parent.PlayerInfo.Weapon.WeaponImage

local Gear = script.Parent.Parent.Parent.Parent.Parent.PlayerInfo.Gear.GearImage

local gear = false

local Type = item.ItemImage.Updater.Type

local Gearequiped = game.ReplicatedStorage.InventoryGui.GearIsEquiped

local equipsound = script.Parent.Parent.Parent.Parent.Parent.Parent.Click

if Gearequiped.Value == item.Name then
	wait()
	
	local image = script.Parent.Parent.ItemImage.Updater.Image
	
	game.Lighting.GUIRemotes.ItemGiver:FireServer(item.Name,nil,image)
	
	if Gearequiped.Value == item.Name then
		equip.BackgroundColor3 = Color3.fromHSV(0, 1, 1)
		equip.Text = "Unequip"

		Gear.Image = script.Parent.Parent.ItemImage.Updater.Image

	else

		Gear.Image = ""

		equip.BackgroundColor3 = Color3.fromRGB(11, 255, 60)
		equip.Text = "Equip"

	end
	
end

Gearequiped.Changed:Connect(function()
	
	
--	if item.Name == "CSludgeHead" or item.Name == "USludgeHead" or item.Name == "RSludgeHead" or item.Name == "PSludgeHead" then
		
		Gear.Image = "rbxthumb://type=Asset&id=6435589354&w=420&h=420"
		
--	end
	
	if Gearequiped.Value == item.Name then
		equip.BackgroundColor3 = Color3.fromRGB(255, 0, 0)
		
		equip.Text = "Unequip"
		
	--	Gear.Image = script.Parent.Parent.ItemImage.Updater.Image.Value
		
	else
		
		Gear.Image = " "
		
		
		
		equip.BackgroundColor3 = Color3.fromRGB(0, 255, 0)
		equip.Text = "Equip"
		
	end
	
	equipsound:Play()
	
end)

equip.MouseButton1Click:Connect(function()
	if Type.Value == "Gear" then	

	if gear == false then

		gear = true
			
		local image = script.Parent.Parent.ItemImage.Updater.Image	
			
			game.Lighting.GUIRemotes.ItemGiver:FireServer(item.Name,nil,image)
			
	else
			
			local image = script.Parent.Parent.ItemImage.Updater.Image	
			
			game.Lighting.GUIRemotes.ItemGiver:FireServer(item.Name,true,image)

		gear = false

		end	
				
	end
end)