Jump to content

help


Flipi

Recommended Posts

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

Link to comment
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 ) 

Link to comment
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) 

Link to comment
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 :D!

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