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.
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:
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
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
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.
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)