i am trying to make inventory, but the script doesn't detect changed values these values are in the buttons in gui and i am using local script.
local Slot1 = script.Parent.Slot1 local Slot2 = script.Parent.Slot2 script.Parent.Slot1.Value.Changed:Connect(function() print("Changed") if Slot1.Value.Value == 1 then Slot1.Image = "http://www.roblox.com/asset/?id=183584653" else Slot1.Image = "http://www.roblox.com/asset/?id=1884857885" end end) script.Parent.Slot2.Value.Changed:Connect(function() print("Changed") if Slot2.Value.Value == 1 then Slot2.Image = "http://www.roblox.com/asset/?id=183584653" else Slot2.Image = "http://www.roblox.com/asset/?id=1884857885" end end)
U gotta use GetPropertyChangedSignal
local Slot1 = script.Parent.Slot1 local Slot2 = script.Parent.Slot2 Slot1:GetPropertyChangedSignal("Value"):Connect(function() print("Changed") if Slot1.Value.Value == 1 then Slot1.Image = "http://www.roblox.com/asset/?id=183584653" else Slot1.Image = "http://www.roblox.com/asset/?id=1884857885" end end) Slot2:GetPropertyChangedSignal("Value"):Connect(function() print("Changed") if Slot2.Value.Value == 1 then Slot2.Image = "http://www.roblox.com/asset/?id=183584653" else Slot2.Image = "http://www.roblox.com/asset/?id=1884857885" end end)
local Slot1 = script.Parent.Slot1 local Slot2 = script.Parent.Slot2 script.Parent.Slot1.Changed:Connect(function(prop) if prop == "Value" then print("Changed") if Slot1.Value.Value == 1 then Slot1.Image = "http://www.roblox.com/asset/?id=183584653" else Slot1.Image = "http://www.roblox.com/asset/?id=1884857885" end end end) script.Parent.Slot2.Changed:Connect(function(prop) if prop == "Value" then print("Changed") if Slot2.Value.Value == 1 then Slot2.Image = "http://www.roblox.com/asset/?id=183584653" else Slot2.Image = "http://www.roblox.com/asset/?id=1884857885" end end end)
Or, you can use :GetPropertyChangedSignal()