# HELP PEOPLE :(

## Recommended Posts

And the people ?, I need help in this resource that I am doing. Random images pass very fast, I thought they would happen little by little but the truth is that I don't know how to make them happen every 2 or 5 seconds and with some effect. Could you give me a hand to finish it please? ```		 local screenW, screenH = guiGetScreenSize()
local startTicking = getTickCount()
Efect = 0

function Intro_Con_Imagenes()

if Efect >= 0 then Efect = Efect + 1 end if Efect >= 255 then Efect = 255 end

local move = interpolateBetween(3, 0, 0, -06, 0, 0, ((getTickCount() - startTicking) / 5000), "InElastic")
local images = math.random(1,7)

end

• Moderators
2 hours ago, Maruchan said:

local images

Not random, but it does it's thing. 14000 / 7 = 2000 ms each image.

`local images = math.max(math.ceil(7 * ((getTickCount() % 14000) / 14000)), 1)`

`getTickCount() % 14000`

This gives you a value between 0 and 13999 in milliseconds. This value counts up, resets and counts up again.

`(getTickCount() % 14000) / 14000)`

Value between 0 and 0.999999999.

`7 * ((getTickCount() % 14000) / 14000)`

Value between 0 and 6.9999999

`math.ceil(7 * ((getTickCount() % 14000) / 14000))`

Value between 0 and 7. (very small chance that the value is 0)

`math.max(math.ceil(7 * ((getTickCount() % 14000) / 14000)), 1)`

Value between 1 and 7.

• 2

¡Perfect bro!.....

`And finally, I would like each image to have a different movement effect, would this be possible?`
` local images = math.max(math.ceil(7 * ((getTickCount() % 14000) / 14000)), "CosineCurve", 1)`

• Moderators
13 hours ago, Maruchan said:

¡Perfect bro!.....

```
And finally, I would like each image to have a different movement effect, would this be possible?```
```
local images = math.max(math.ceil(7 * ((getTickCount() % 14000) / 14000)), "CosineCurve", 1)```

The easing?

```-- The first 7 of this table are used:
local strEasingTypes = { "Linear", "InQuad", "OutQuad", "InOutQuad", "OutInQuad", "InElastic", "OutElastic", "InOutElastic", "OutInElastic", "InBack", "OutBack", "InOutBack", "OutInBack", "InBounce", "OutBounce", "InOutBounce", "OutInBounce", "SineCurve", "CosineCurve" }

local images = math.max(math.ceil(7 * ((getTickCount() % 14000) / 14000)), 1)
local move = interpolateBetween(3, 0, 0, -06, 0, 0, ((getTickCount() - startTicking) / 5000), strEasingTypes[images])
```

• 1

## Create an account

Register a new account