Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

When I change the image the decal won't show up?

Asked by 4 years ago

When I set an ImageButtons image value to a decal it does change but the decal doesn't change on screen

local plr = game.Players.LocalPlayer or game.Players.PlayerAdded:Wait()
local Inventory = plr:WaitForChild('Inventory')
local Frame = script.Parent
local Slot1 = Frame.Slot1.ImageButton.TextLabel
local Slot2 = Frame.Slot2.ImageButton.TextLabel
local Slot3 = Frame.Slot3.ImageButton.TextLabel
local Slot4 = Frame.Slot4.ImageButton.TextLabel
local Slot5 = Frame.Slot5.ImageButton.TextLabel
local Slot6 = Frame.Slot6.ImageButton.TextLabel
local Slot7 = Frame.Slot7.ImageButton.TextLabel
local Slot8 = Frame.Slot8.ImageButton.TextLabel
local Slot9 = Frame.Slot9.ImageButton.TextLabel
local Slots = {Slot1,Slot2,Slot3,Slot4,Slot5,Slot6,Slot7,Slot8,Slot9}
while wait() do
    Slot1.Text = Inventory.Slot1.Value
    Slot2.Text = Inventory.Slot2.Value
    Slot3.Text = Inventory.Slot3.Value
    Slot4.Text = Inventory.Slot4.Value
    Slot5.Text = Inventory.Slot5.Value
    Slot6.Text = Inventory.Slot6.Value
    Slot7.Text = Inventory.Slot7.Value
    Slot8.Text = Inventory.Slot8.Value
    Slot9.Text = Inventory.Slot9.Value
    for i,v in pairs(Inventory:GetChildren()) do
        for i,v in pairs(v:GetChildren()) do
            if v.Value == 'Rock' then
                print('hello')
                Slots[i].Parent.Image = 'http://www.roblox.com/asset/?id=4554739247'
                print('Changed '..Slots[i].Parent.Image)
            elseif v.Value == 'Wood' then
                Slots[i].Parent.Image = 'Wood'
            elseif v.Value == '' then
                Slots[i].Parent.Image = ''
            end
        end
    end
end
0
Which decal will not show up; http://www.roblox.com/asset/?id=4554739247, or Wood User#28017 0 — 4y
0
It's fine I figured out how to fix it by myself User_3805 6 — 4y

Answer this question