mcer Posted June 9, 2013 Posted June 9, 2013 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.
DNL291 Posted June 9, 2013 Posted June 9, 2013 MilitaryN = guiCreateLabel(104, 427, 70, 19, MilitaryCount, false, TeaSelectorWin) guiLabelSetColor(MilitaryN, 106, 105, 109) Or: guiSetText(MilitaryN, MilitaryCount)
mcer Posted June 9, 2013 Author Posted June 9, 2013 MilitaryN = guiCreateLabel(104, 427, 70, 19, MilitaryCount, false, TeaSelectorWin) guiLabelSetColor(MilitaryN, 106, 105, 109) Or: guiSetText(MilitaryN, MilitaryCount) It does not work. D:
iPrestege Posted June 9, 2013 Posted June 9, 2013 -- # 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 )
mcer Posted June 9, 2013 Author Posted June 9, 2013 -- # 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:
iPrestege Posted June 9, 2013 Posted June 9, 2013 Are you sure you have team called ''Military' ? Also use debugscript 3 to tell us what's the problem .
DNL291 Posted June 9, 2013 Posted June 9, 2013 It should work. Make sure that 'MilitaryCount' is really returning the players in the team.
mcer Posted June 9, 2013 Author Posted June 9, 2013 (edited) 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 June 9, 2013 by Guest
iPrestege Posted June 9, 2013 Posted June 9, 2013 Debugscript: We can't see this image please use another upload site . like imgur .
mcer Posted June 9, 2013 Author Posted June 9, 2013 Debugscript: We can't see this image please use another upload site . like imgur . See it again .
mcer Posted June 9, 2013 Author Posted June 9, 2013 Debugscript tells me the error is here: guiSetText ( MilitaryN,tostring ( Count ) ) Bad argument @ 'guiSetText [Expected gui-element at argument 1,got nil]
WASSIm. Posted June 9, 2013 Posted June 9, 2013 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 )
mcer Posted June 9, 2013 Author Posted June 9, 2013 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
iPrestege Posted June 9, 2013 Posted June 9, 2013 Oh There's an argument on create the label i don't see it lol .
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now