Jump to content

easiest way to do this?


xTravax

Recommended Posts

Posted

hello, what would be easiest way to change value from e.g 0 to 20 (like goes up 0,1,2,3 to 20) and when it reaches 20 it goes to 0 like (20,19,28 to 0) and then starts doing this again over and over again(like a loop)

thanks in advance

Posted

I made an example with the onClientRender event.

There might be an easier way to do this, but this is what came into my mind.

Untested.

value = 0 
des = false 
function onRender() 
    value = value + (des and -1 or 1) 
    if value >= 20 or value <= 0 then 
        des = not des 
    end 
end 
addEventHandler("onClientRender",root,onRender) 

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...