Sign in to follow this  
koviak98

[Help] Scoreboard

Recommended Posts

Posted (edited)

Hi :) I started a few days ago lua scripting, my first project is an scoreboard. But i have an issue. I can't test my job, because don't have enought players on my custom server. I can join from my laptop, but this is just 2 player ( my pc and laptop). My question, that how can i set scoreboard bots (just a few, example 10) for the test? :)

Edited by koviak98

Share this post


Link to post
Posted (edited)

Use loop

As example:

function updateScoreboard()
  scoreboard = {}
  for _, player in ipairs(getElementsByType("player")) do
    if not getPlayerTeam(player) then
      for n = 1, 10 do
        table.insert(scoreboard, {"player", player})
      end
    end
end

 

Edited by SaNoR

Share this post


Link to post

Just create some peds, insert them into the table, and thats it.

Share this post


Link to post

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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.