HelpEach variable gets a player?

Posts 16 of 6 · Page 1 of 1
Each variable gets a player?
Basically what I'm wanting to do it have a variable clone itself for the number of players, and set each clone to a player. Can anyone tell me how to do this?

var[1] = Player1
var[2] = Player2
Code:
local players = player.GetAll()
Quote Originally Posted by tdsx View Post
Code:
local players = player.GetAll()
I feel like an idiot for not thinking of that but basically what I'm trying to do is modify a menu to include all players and when you select a player it displays their money below the name. I don't know how to properly modify it. I'm new to lua and I'm working my way up the ladder.

Code:
	scrubs = player.GetAll()
	local hitLab = vgui.Create( "DLabel", hitFrame )
	hitLab:SetPos( hitFrame:GetWide() / 2 - 87 / 2, 35 )
	hitLab:SetFont( "ChatFont" )
	hitLab:SetTextColor( Color( 51, 204, 255, 255 ) )
	hitLab:SetText( "Place Hit On:" )
	hitLab:SizeToContents()

	local hitBox = vgui.Create( "DComboBox", hitFrame )
	hitBox:SetPos( hitFrame:GetWide() / 2 - 50, 55 )
	hitBox:SetSize( 100, 20 )
			hitBox:AddChoice( scrubs )
(Yes, I snagged the menu from a hitman addon because I'm shit)
Quote Originally Posted by ShitFucks View Post
I feel like an idiot for not thinking of that but basically what I'm trying to do is modify a menu to include all players and when you select a player it displays their money below the name. I don't know how to properly modify it. I'm new to lua and I'm working my way up the ladder.

Code:
	scrubs = player.GetAll()
	local hitLab = vgui.Create( "DLabel", hitFrame )
	hitLab:SetPos( hitFrame:GetWide() / 2 - 87 / 2, 35 )
	hitLab:SetFont( "ChatFont" )
	hitLab:SetTextColor( Color( 51, 204, 255, 255 ) )
	hitLab:SetText( "Place Hit On:" )
	hitLab:SizeToContents()

	local hitBox = vgui.Create( "DComboBox", hitFrame )
	hitBox:SetPos( hitFrame:GetWide() / 2 - 50, 55 )
	hitBox:SetSize( 100, 20 )
			hitBox:AddChoice( scrubs )
(Yes, I snagged the menu from a hitman addon because I'm shit)
make a picture in paint, your explainations aren't clear enough
Quote Originally Posted by Kona-chan View Post
make a picture in paint, your explainations aren't clear enough
A menu similar to this except only two entry boxes and the total at the bottom that will display the currently selected player's money. I don't need you to make the menu for me, I can do that. I just need to know how to make it update showing the selected player's money in the total section.


Posts 16 of 6 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Need help?