Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local random = Random.new()
- local randomMin, randomMax = 100, 99999
- local InventoryService = {}
- function InventoryService.getRandomNumber()
- return random:NextInteger(randomMin, randomMax)
- end
- function InventoryService:GetUniqueSerial(Inventory)
- local armors = Inventory["Armors"]
- local weapons = Inventory["Weapons"]
- local uniqueSerial
- local function recursion()
- uniqueSerial = self.getRandomNumber()
- if armors[uniqueSerial] or weapons[uniqueSerial] then
- recursion()
- end
- end
- recursion()
- return uniqueSerial
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement