RN.Value = (math.random(7)) if RN.Value == LRN.Value then print "Same Number!" while RN.Value == LRN.Value do RN.Value = (math.random(7)) end elseif RN.Value ~= LRN.Value then print "New Number!" end print(RN.Value) LRN.Value = RN.Value
RN = Room Number LRN = Last Room Number
That script above is made so that the same room number can't be generated twice in a row. If it is, it's supposed to keep generating numbers until it gets a new number, but it doesn't work. It always prints 'New Number!' even when it's the same number as last time. Can someone help me fix this to work properly? Thanks.