Trying to get a random 4-digit code for a locked door in my game but I want the password to have no repeating numbers. How would I do this?
Code:
local startCode = game.ReplicatedStorage.startCode
local numb1 = math.random(0, 9)
local numb2 = math.random(0, 9)
local numb3 = math.random(0, 9)
local numb4 = math.random(0, 9)
startCode.Value = (tostring(numb1) .. tostring(numb2) .. tostring(numb3) .. tostring(numb4))
print(startCode.Value)
