ULX

Author Topic: Lua Help  (Read 2753 times)

0 Members and 1 Guest are viewing this topic.

Offline Cyrk

  • Newbie
  • *
  • Posts: 1
  • Karma: 0
Lua Help
« on: August 28, 2008, 03:53:05 PM »
Hey there... I'm a new scripter so you have to remember that lol ;p, But on your admin mod.. I need to know how you looped through every player and put a button for each player in the derma panel. I also would like to know how you make HUD health bar and Ammo and shield bar, not text. Thanks! =D

Offline jay209015

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 934
  • Karma: 62
    • Dev-Solutions
Re: Lua Help
« Reply #1 on: August 28, 2008, 05:58:54 PM »
Code: [Select]
for k, v in pairs(player.GetAll()) do
combobox:AddItem(v:Nick())
end

Where combobox is the vgui element that you created with:

Code: [Select]
combobox = vgui.Create( "DComboBox" )
That's for listing all players on a vgui.
For more info go HERE
An error only becomes a mistake when you refuse to correct it. --JFK

"And thus the downfall of the great ULX dynasty was wrought not by another dynasty, but the slow and steady deterioration of the leaders themselves, followed by the deprecation of the great knowledge they possessed." -Gmod, Chapter 28, verse 34 -- Stickly