Advertisement
KodingKid

Lua basic dice roll - Basic Scripting #34

Jun 30th, 2021
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.39 KB | None | 0 0
  1. function RollDice(side)
  2.     if side = 1 then
  3.         return "1"
  4.         end
  5.     elseif side = 2 then
  6.         return "2"
  7.         end
  8.     elseif side = 3 then
  9.         return "3"
  10.         end
  11.     elseif side = 4 then
  12.         return "4"
  13.         end
  14.     elseif side = 5 then
  15.         return "5"
  16.         end
  17.     elseif side = 6 then
  18.         return "6"
  19. print(RollDice(math.random(1,6)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement