Jump to content

Make an scoreboard?


Recommended Posts

Out from this pointless confrontation that you're having over here, I recommend you to begin with the following piece of code:

local scoreboard = {data = {}} 
function scoreboard:generate () 
    local data = {players = {}, teams = {}) 
    for i,v in ipairs(getElementsByType("team")) do 
        data.teams[v] = {} 
    end 
    for i,v in ipairs(getElementsByType("player")) do 
        local team = getPlayerTeam(v) 
        if not team then 
            table.insert(data.players, v) 
        else 
            table.insert(data.teams[team], v) 
        end 
    end 
    self.data = data 
end 

Once held all the necessary data on a table, you will simply need to use dx functions whilst looping over it.

Link to comment
Bonsai, why you always say that i cant? Just if you dont wanna help just ignore my post ...

Because its always the same.

You ask what functions you have to use.

Someone posts them.

After that you ask for an example, whatever you mean by that.

But it feels like you never actually finish something, considering your skills don't seem to improve at all.

I would like to help you, but you always ask this weird questions.

You should at least have tried something on your own before you post here, so you can ask about some specific problem.

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