Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Targs={...}
- x = Targs[1]
- x=tonumber(x)
- HUD = peripheral.wrap("right")
- HUD.clear()
- HUD.addBox(1,1,26,106, 0x000000, .4)
- y = 0
- j = 0
- local perc = 0
- for i = 0,10 do
- y = i*10
- for j = 0,9 do
- --check for closest decimal, rounded down
- if (x > y + j) and (x < y + j+1 ) then
- perc = y+j
- --giving that value a variable
- end
- end
- end
- HUD.addBox(4,104-perc, 20, perc, 0x6813d6, .4)
- --displaying on hud
- print(perc)
- print(y)
- print(j)
- print(l)
- print(x)
- --printing on screen
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement