local plr = game:GetService('Players').LocalPlayer local Store = workspace.Stores:WaitForChild(plr.Name) local Shelves = Store.Shelves -- Auto restock for "Store Empire" -- Cappucino on top. if your going to use this code for your hub/script atleast credit me (doggo#4168) local settings = { ItemLimitStock = 2, -- The limit of how low the stock needs to be when it refils ItemBuyAmount = 25 -- The amount of how much it will buy the item } for i,v in next, Shelves:GetChildren() do v.BASE.Stock.Changed:Connect(function() if Store.Inventory:FindFirstChild(v.BASE.ItemType.Value).Value < settings.ItemLimitStock then print('Buying "'..v.BASE.ItemType.Value..'" | For:'..v.Name..',CurrentStock:'..Store.Inventory[v.BASE.ItemType.Value].Value) local ohInstance1 = Store local ohString2 = v.BASE.ItemType.Value local ohNumber3 = settings.ItemBuyAmount game:GetService('ReplicatedStorage').ZRHVPR.ZGGPGQ:FireServer(ohInstance1, ohString2, ohNumber3) end print('Refilling "'..v.Name..'" | With:'..v.BASE.ItemType.Value) local ohInstance1 = Store local ohInstance2 = v local ohString3 = v.BASE.ItemType.Value game:GetService('ReplicatedStorage').ZRHVPR.FGRQFQ:FireServer(ohInstance1, ohInstance2, ohString3) end) end Shelves.ChildAdded:Connect(function(v) -- ok v:WaitForChild("BASE").Stock.Changed:Connect(function() if Store.Inventory:FindFirstChild(v.BASE.ItemType.Value).Value < settings.ItemLimitStock then print('Buying "'..v.BASE.ItemType.Value..'" | For:'..v.Name..',CurrentStock:'..Store.Inventory[v.BASE.ItemType.Value].Value) local ohInstance1 = Store local ohString2 = v.BASE.ItemType.Value local ohNumber3 = settings.ItemBuyAmount game:GetService('ReplicatedStorage').ZRHVPR.ZGGPGQ:FireServer(ohInstance1, ohString2, ohNumber3) end print('Refilling "'..v.Name..'" | With:'..v.BASE.ItemType.Value) local ohInstance1 = Store local ohInstance2 = v local ohString3 = v.BASE.ItemType.Value game:GetService('ReplicatedStorage').ZRHVPR.FGRQFQ:FireServer(ohInstance1, ohInstance2, ohString3) end) end)