SkrillexX Posted March 9, 2014 Share Posted March 9, 2014 Greetings , i want to make a continous outPutChatbox which means for example "Visit Our Forums at www.randomforum.com" But i want it to output Once each 5 minutes , How to do that ? Link to comment
WhoAmI Posted March 9, 2014 Share Posted March 9, 2014 setTimer ( function ( ) local message = "Here message" outputChatBox ( message ) end, 300000, 0 ) Link to comment
Hell-Mate Posted March 10, 2014 Share Posted March 10, 2014 setTimer ( outputChatBox, 500000, 0, "Text Here", root ) Link to comment
Karuzo Posted March 10, 2014 Share Posted March 10, 2014 setTimer ( outputChatBox, 500000, 0, "Text Here", root ) 500000 ms are not 5 Minutes... 300000 ms are 5 Minutes. Link to comment
Hell-Mate Posted March 10, 2014 Share Posted March 10, 2014 setTimer ( outputChatBox, 500000, 0, "Text Here", root ) 500000 ms are not 5 Minutes... 300000 ms are 5 Minutes. okay .- Link to comment
Anubhav Posted March 10, 2014 Share Posted March 10, 2014 (edited) You can also do it by random messages each 5 minutes. local theMessages = { 'Welcome to the server!', 'Visit our website. [url=http://www.randomforum.com']http://www.randomforum.com'[/url], 'Enjoy our server.' } function outputit() local r,g,b = 255,0,0 outputChatBox(theMessages[math.random(#theMessages)],ROOT,255,0,0) end setTimer(outputit,300000,0) Edited March 10, 2014 by Guest Link to comment
arezu Posted March 10, 2014 Share Posted March 10, 2014 You can also do it by random messages each 5 minutes. local theMessages = { 'Welcome to the server!', 'Visit our website. [url=http://www.randomforum.com']http://www.randomforum.com'[/url], 'Enjoy our server.' } function outputit() local r,g,b = 255,0,0 outputChatBox(theMessages[math.random(#theMessages)],source,255,0,0) end setTimer(outputit,300000,0) Should be root instead of source there. Link to comment
Anubhav Posted March 10, 2014 Share Posted March 10, 2014 Thanks for correcting me. Fixed. Link to comment
teQuilla Posted March 10, 2014 Share Posted March 10, 2014 You can also do it by random messages each 5 minutes. local theMessages = { 'Welcome to the server!', 'Visit our website. [url=http://www.randomforum.com']http://www.randomforum.com'[/url], 'Enjoy our server.' } function outputit() local r,g,b = 255,0,0 outputChatBox(theMessages[math.random(#theMessages)],ROOT,255,0,0) end setTimer(outputit,300000,0) local r,g,b = 255,0,0 Why are you still using this line if you don't use your variables anyway ? You could use it like this if you would like , but I find no use in it. outputChatBox(theMessages[math.random(#theMessages)],root,r,g,b) Link to comment
Saml1er Posted March 10, 2014 Share Posted March 10, 2014 Thanks for correcting me. Fixed. sorry to tell you but its not ROOT, use getRootElement() even if you did it on purpose but just think how will newbies understand. Link to comment
teQuilla Posted March 10, 2014 Share Posted March 10, 2014 LUA is case-sensitive , I don't think ROOT works , though you could replace it by simply " root " ._. root is the global for "getRootElement()" , like localPlayer . 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