SnoopCat Posted March 26, 2011 Share Posted March 26, 2011 hey here i want to make a script that shows u players loged in all is working fine but i want to put them to show whit random colors and they are not woring can u help me ??? there is the code... function playerCount ( ) outputChatBox ( "Ahora Hay" .. getPlayerCount().. " Jugadores En el Servidor", getRootElement(), local r,g,b = math.random(0, 255),math.random(0, 255),math.random(0, 255), true ) end addEventHandler ( "onPlayerJoin", getRootElement(), playerCount ) addEventHandler ( "onPlayerQuit", getRootElement(), playerCount ) can u plz say me what is wrong? Link to comment
Moderators Citizen Posted March 26, 2011 Moderators Share Posted March 26, 2011 function playerCount ( ) outputChatBox ( "Ahora Hay ".. getPlayerCount().." Jugadores En el Servidor", getRootElement(), math.random(0, 255),math.random(0, 255),math.random(0, 255) ) end addEventHandler ( "onPlayerJoin", getRootElement(), playerCount ) addEventHandler ( "onPlayerQuit", getRootElement(), playerCount ) Link to comment
Arran Posted March 26, 2011 Share Posted March 26, 2011 function playerCount ( ) outputChatBox ( "Ahora Hay ".. getPlayerCount().." Jugadores En el Servidor", root, math.random(255), math.random(255), math.random(255) ) end addEventHandler ( "onPlayerJoin", root, playerCount ) addEventHandler ( "onPlayerQuit", root, playerCount ) Even shorter. You don't need to specify a lower number in math.random if you want 0. root is the same as getRootElement() just 5 times quicker to type. 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