manve1 Posted December 6, 2012 Share Posted December 6, 2012 I am trying to make a script which set one label to a random number between 1 and 90, but when i set it using math.random it sets it only to 1 number, and i want like to expand it, and have it like filled fully, till the end of the label, not just one number local rp = guiCreateWindow( 0.1, 0.15, 0.8, 0.75, '', true ) local troll = guiCreateLabel( 0.05, 0.05, 0.9, 0.05, '', true, rp) setTimer( function() guiSetText( troll, math.random( 1, 90 ) ) end, 5000, 1 ) Edit: would it be possible to make all numbers different? Link to comment
Anderl Posted December 6, 2012 Share Posted December 6, 2012 You mean keep adding numbers to what is already on the label? guiSetText( troll, guiGetText( troll ) .. tostring( math.random( 90 ) ) ); Link to comment
manve1 Posted December 6, 2012 Author Share Posted December 6, 2012 Not adding to the label numbers, but like if i created a label at a wide of '0.8' i want to fill all of it in but with random numbers till 90 Link to comment
Tete omar Posted December 7, 2012 Share Posted December 7, 2012 use: math.random(1,90) Link to comment
Castillo Posted December 7, 2012 Share Posted December 7, 2012 He already knows that Teteomar, he wants to fill all the label with random numbers. @Manve: Maybe you can use this function: guiLabelGetTextExtent Link to comment
manve1 Posted December 7, 2012 Author Share Posted December 7, 2012 @Solidsnake14 Thanx @Teteomar have you looked at my first (( the topic )) post? it already has math.random( 1, 90 ) Link to comment
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