Adde Posted December 3, 2013 Posted December 3, 2013 Hello, I am trying to do a table with (messages, r, g, b) to use that for outputTopChat. I have successed, but now I only need to now how I randomize the rows to the function. I tried to use math.random but it said that it wasn´t numbers I used. Atm the it works but shows all messages at the same time every 40second. Can anyone help me? :> local messages = { { "*Info* Staff can be found with infront of their name", 255, 255, 255 }, { "*Rule* Speak english in main chat! Use local chat, team chat or group chat for other languages!", 255, 255, 255 }, { "*Info* This server need YOU to donate! Read more about donation in F1 panel.", 255, 255, 255 }, { "*Info* You can start music by type /soundon, then stop it by type /soundoff", 255, 255, 255 }, { "*Info* If we can get 60 players online at the same time then everyone will be able to use vip for 6days!", 255, 255, 255 } } function sendMessages() for k, v in ipairs(messages) do outputTopChat(v[1], v[2], v[3], v[4]) end end setTimer(sendMessages, 1000*40, 0) My ingame nickname is: Mr.Snus
Castillo Posted December 3, 2013 Posted December 3, 2013 local messages = { { "*Info* Staff can be found with infront of their name", 255, 255, 255 }, { "*Rule* Speak english in main chat! Use local chat, team chat or group chat for other languages!", 255, 255, 255 }, { "*Info* This server need YOU to donate! Read more about donation in F1 panel.", 255, 255, 255 }, { "*Info* You can start music by type /soundon, then stop it by type /soundoff", 255, 255, 255 }, { "*Info* If we can get 40 players online at the same time then everyone will be able to use vip for 6days!", 255, 255, 255 } } function sendMessages ( ) outputTopChat ( unpack ( messages [ math.random ( #messages ) ] ) ) end setTimer ( sendMessages, ( 1000 * 40 ), 0 ) San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Castillo Posted December 3, 2013 Posted December 3, 2013 You're welcome. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
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