Advertisement
Mangus875

Untitled

Jan 8th, 2025
26
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- Exit 8
  2.  
  3. math.randomseed(os.clock())
  4.  
  5. local anomalies = {}
  6. local curAnom = 1
  7.  
  8. local function shuffle(tbl)
  9.     for i = #tbl, 2, -1 do
  10.         local j = math.random(i)
  11.         tbl[i], tbl[j] = tbl[j], tbl[i]
  12.     end
  13.     return tbl
  14. end
  15.  
  16. local function nextAnomaly()
  17.     curAnom++
  18.     if (curAnom > #anomalies) then
  19.         anomalies = shuffle(anomalies)
  20.         curAnom = 1
  21.     end
  22. end
  23.  
  24. local function loadAnomaly() {
  25.     game.ServerStorage
  26. }
  27.  
  28. local function newRoom()
  29.     local weirdness = 0.5
  30.     if (math.random() < weirdness) then
  31.         loadAnomaly()
  32.         nextAnomaly()
  33.     end
  34. end
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement