Taquito Posted March 8, 2015 Share Posted March 8, 2015 (edited) Hi, this is chat infobot I own -- wiadomosci local messages = { "Check out our forum - #fbaf17", "Type #ff5000/nos nfs #ffff00for NFS Nos, or #ff5000/nos normal #ffff00for Normal NOS", } local r,g,b = 255,255,0 -- default color; #ffff00 local stime = 210 -- time in seconds setTimer( function() local msg = messages[math.random(1,#messages)] outputChatBox( msg, getRootElement(), r, g, b, true ) end, stime*1000,0 ) This is how it works, it shows messages randomly How do I make it so it works like this? Edited March 8, 2015 by Guest Link to comment
xXMADEXx Posted March 8, 2015 Share Posted March 8, 2015 I don't understand what you're trying to do. Can you please be a little bit more specific? Link to comment
DNL291 Posted March 8, 2015 Share Posted March 8, 2015 I think he wants to show the messages in sequence and not randomly. -- wiadomosci local current = 1 local messages = { "Check out our forum -#fbaf17", "Type #ff5000/nos nfs #ffff00for NFS Nos, or #ff5000/nos normal #ffff00for Normal NOS", } local r,g,b = 255,255,0 -- kolor domyslny; #ffff00 local stime = 10 -- czas w sekundach setTimer( function() if current > #messages then current = 1 end local msg = messages[current] outputChatBox( msg, getRootElement(), r, g, b, true ) current = current + 1 end, stime*1000,0 ) Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now