Flipi Posted September 16, 2013 Posted September 16, 2013 hi, how to add a message that says the number of players on the server? local msgs = { '* welcome!', '* name server!', '* register and login!' } setTimer( function() outputChatBox( msgs[math.random( 1, #msgs )], root, 255, 255, 255, true ) end, 25000, 0 ) function that can be used is this? : ..getPlayerCount()..
TAPL Posted September 16, 2013 Posted September 16, 2013 To get the number of players in the server you can use getPlayerCount or even getElementsByType in case you wanted to get it client side. Thought i don't see a relation with what you ask about and the code you post.
Flipi Posted September 16, 2013 Author Posted September 16, 2013 To get the number of players in the server you can use getPlayerCount or even getElementsByType in case you wanted to get it client side.Thought i don't see a relation with what you ask about and the code you post. How I can add function of number of player in the server in automatic message from my script? local msgs = { '* welcome!', '* name server!', '* register and login!', '[u][i][b]* players online '..getPlayerCount()..' in the server[/b][/i][/u]' } setTimer( function() outputChatBox( msgs[math.random( 1, #msgs )], root, 255, 255, 255, true ) end, 25000, 0 )
TAPL Posted September 16, 2013 Posted September 16, 2013 local msgs = { '* welcome!', '* name server!', '* register and login!', 'players online' } setTimer(function() local text = msgs[math.random(1, #msgs)] if text == "players online" then outputChatBox("* players online "..getPlayerCount().." in the server", root, 255, 255, 255, true) else outputChatBox(text, root, 255, 255, 255, true) end end, 25000, 0)
Flipi Posted September 16, 2013 Author Posted September 16, 2013 local msgs = { '* welcome!', '* name server!', '* register and login!', 'players online' } setTimer(function() local text = msgs[math.random(1, #msgs)] if text == "players online" then outputChatBox("* players online "..getPlayerCount().." in the server", root, 255, 255, 255, true) else outputChatBox(text, root, 255, 255, 255, true) end end, 25000, 0) thanks TAPL !
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