Jump to content

Help with GUI LABEL


mcer

Recommended Posts

I can't put

local MilitaryCount = countPlayersInTeam ( Military ) 

In this GUIlabel (Don't appear when i put "MilitaryCount" in the code)

        MilitaryN = guiCreateLabel(104, 427, 70, 19, "Number", false, TeaSelectorWin) 
        guiLabelSetColor(MilitaryN, 106, 105, 109) 

I want to replace "number" With the number of a specific team.

Please help.

Link to comment

-- # Client Side .. 
MilitaryN = guiCreateLabel(104, 427, 70, 19, MilitaryCount, false, TeaSelectorWin) 
guiLabelSetColor(MilitaryN, 106, 105, 109) 
  
addEventHandler('onClientRender',root, 
    function    (       ) 
        local Count = countPlayersInTeam ( getTeamFromName ( 'Military' ) ) 
            guiSetText ( MilitaryN,tostring ( Count ) ) 
    end 
) 

Link to comment
-- # Client Side .. 
MilitaryN = guiCreateLabel(104, 427, 70, 19, MilitaryCount, false, TeaSelectorWin) 
guiLabelSetColor(MilitaryN, 106, 105, 109) 
  
addEventHandler('onClientRender',root, 
    function    (       ) 
        local Count = countPlayersInTeam ( getTeamFromName ( 'Military' ) ) 
            guiSetText ( MilitaryN,tostring ( Count ) ) 
    end 
) 

Doesn't work too D:

Link to comment

Debugscript:

Bad argument @ 'guiSetText [Expected gui-element at argument 1,got nil]

With this

-- # Client Side .. 
MilitaryN = guiCreateLabel(104, 427, 70, 19, MilitaryCount, false, TeaSelectorWin) 
guiLabelSetColor(MilitaryN, 106, 105, 109) 
  
addEventHandler('onClientRender',root, 
    function    (       ) 
        local Count = countPlayersInTeam ( getTeamFromName ( 'Military' ) ) 
            guiSetText ( MilitaryN,tostring ( Count ) ) 
    end 
) 

Edited by Guest
Link to comment

try this:

MilitaryN = guiCreateLabel(104, 427, 70, 19, "", false, TeaSelectorWin) 
guiLabelSetColor(MilitaryN, 106, 105, 109) 
  
addEventHandler('onClientRender',root, 
    function    ( ) 
        local Count = countPlayersInTeam ( getTeamFromName ( 'Military' ) ) 
            guiSetText ( MilitaryN, Count  ) 
    end 
) 

Link to comment
try this:
MilitaryN = guiCreateLabel(104, 427, 70, 19, "", false, TeaSelectorWin) 
guiLabelSetColor(MilitaryN, 106, 105, 109) 
  
addEventHandler('onClientRender',root, 
    function    ( ) 
        local Count = countPlayersInTeam ( getTeamFromName ( 'Military' ) ) 
            guiSetText ( MilitaryN, Count  ) 
    end 
) 

Finally!!, Thanks all :mrgreen:

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