Jump to content

Alpha multiple problem


Overkillz

Recommended Posts

Hey guys, im trying to create a multiple alpha on each message, its the first time that I do this but it doesnt work, when the player type /adda message it will add the message and I want the alpha start too on each message for individual messages

local sX, sY = guiGetScreenSize() 
local sizeX = sX/2 
local sizeY = sY/2 
local lista = {} 
local alpha = {} 
  
function dxDrawAnimation() 
    for i=1,#lista do 
        alpha[i] = alpha[i] + 30 
        if alpha[i] >= 255 then 
            alpha[i] = 255 
        end 
        dxDrawText("Text: "..lista[i],sX/2-sizeX/2,(sY/2-sizeY/2)+10*(i-1),0,0,tocolor(255,255,255,alpha[i]),1,"default-bold","left","top",false,false,false,true) 
    end 
end 
addEventHandler("onClientRender",getRootElement(),dxDrawAnimation) 
  
function rellenateTable(value) 
    table.insert(lista,value) 
end 
addCommandHandler("adda",rellenateTable) 

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