robocyclone

Untitled

Nov 27th, 2016
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.32 KB | None | 0 0
  1. local function roll(stat, difficulty)
  2.   if stat < difficulty then
  3.     local difference = (difficulty - stat)*10
  4.     local seed = math.random(1, difference)
  5.     if seed >= 50 then
  6.       return true
  7.     else
  8.       return false
  9.     end
  10.   elseif stat >= difficulty then
  11.     return true
  12.   else
  13.     return false
  14.   end
  15. end
Advertisement
Add Comment
Please, Sign In to add comment