I am trying to make inventory so once player gets value 1 he gets an item but the image dosen't show up once i have i item
local Slot1 = script.Parent.Slot1 local Slot2 = script.Parent.Slot2 while true do wait(1) if Slot1.Value == 1 then Slot1.Image = ("http://www.roblox.com/asset/?id=183584653") else Slot1.Image = ("http://www.roblox.com/asset/?id=1884857885") end if Slot2.Value == 1 then Slot2.Image = ("http://www.roblox.com/asset/?id=183584653") else Slot2.Image = ("http://www.roblox.com/asset/?id=1884857885") end wait(1) end
its very unpractical to put it in a while loop. Try using events instead:
local Slot1 = script.Parent.Slot1 local Slot2 = script.Parent.Slot2 local Slot1Check = --Create an IntValue local Slot2Check = --Create another IntValue Slot1Check.Changed:Connect(function() if Slot1Check.Value == 1 then--[[Also, Slot1 and Slot2 don't have a Value (At least from what we can see). So you must create Another Variable.]] Slot1.Image = ("http://www.roblox.com/asset/?id=183584653") else Slot1.Image = ("http://www.roblox.com/asset/?id=1884857885") end end) Slot2Check.Changed:Connect(function() if Slot2Check.Value == 1 then Slot2.Image = ("http://www.roblox.com/asset/?id=183584653") else Slot2.Image = ("http://www.roblox.com/asset/?id=1884857885") end end)