Jump to content

Question about %


iMr.WiFi..!

Recommended Posts

  • MTA Team
Posted

% is modulo. It gives you the remainder from a division

2 % 1 = 0

3 % 2 = 1

50 % 23 = 4

and so on

Posted
25 minutes ago, LopSided_ said:

% is modulo. It gives you the remainder from a division

2 % 1 = 0

3 % 2 = 1

50 % 23 = 4

and so on

i understand it before your comment, however thanks for helping .. 

  • Moderators
Posted

It is very useful for repeating (dx) animations.
 

local duration = 4000 -- ms

local progress = getTickCount() % duration / duration
-- progress 0 t/m 1

 

  • Like 3
Posted
10 hours ago, IIYAMA said:

It is very useful for repeating (dx) animations.
 


local duration = 4000 -- ms

local progress = getTickCount() % duration / duration
-- progress 0 t/m 1

 

Good example, wow ! 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...