Jump to content

Question :S


#Paper

Recommended Posts

So, i have a lol image, and i have to show it in the screen: more is the speed more times the lol appears in the screen, less is the speed less times the lol appear in the screen.

Example:

I go to 20mph, the lol appears and disappears 13(random value) times in 20 seconds.

I go to 200mph, the lol appears and disappears 18(random value) times in 20 seconds.

Someone can explain me how to do? :S

Link to comment

Sounds sortof like a speedometer ?

Create all the images, put them in a table.

Use a timer or onClientRender to calculate how many you want to show, hide the rest.

local images={} 
for i = 1, 20 do  
    images[i] = guiCreateStaticImage(0 + width * i, 0, width, heigth, "lol.png", false) 
    guiSetVisible(images[i], false) 
end 
  
function update() 
    --here you do your calculations of how much images you want to be shown, store it into "amount" 
    local amount = ... 
     
     
    for i = 1, amount do 
        guiSetVisible(images[i], true]) 
    end 
    for i = amount + 1, #images do 
        guiSetVisible(images[i], false]) 
    end 
end 
setTimer(update, 500, 0) 

Link to comment

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