TheCapn Posted February 21, 2014 Share Posted February 21, 2014 Hello guys, How can I send a custom message with colours to all players ? Because the second argument of outputChatBox must be a "player" and if I go directly to the "third" argument, there is an error. Regards, Link to comment
Bonsai Posted February 21, 2014 Share Posted February 21, 2014 Use root. Thats the parent of anything, therefore its for all players. Link to comment
J.S. Posted February 22, 2014 Share Posted February 22, 2014 You can also do a loop: for i,v in ipairs(getElementsByType("player")) do outputChatBox("Message here", v, 0, 0, 0) -- change 0,0,0 to your colors. end Link to comment
xXMADEXx Posted February 22, 2014 Share Posted February 22, 2014 You can also do a loop: for i,v in ipairs(getElementsByType("player")) do outputChatBox("Message here", v, 0, 0, 0) -- change 0,0,0 to your colors. end That's un-efficient, use root or getRootElement(). Link to comment
J.S. Posted February 22, 2014 Share Posted February 22, 2014 You can also do a loop: for i,v in ipairs(getElementsByType("player")) do outputChatBox("Message here", v, 0, 0, 0) -- change 0,0,0 to your colors. end That's un-efficient, use root or getRootElement(). It takes very little at all to process it using a loop so it can be done either way. Link to comment
Controlled Posted February 22, 2014 Share Posted February 22, 2014 You can also do a loop: for i,v in ipairs(getElementsByType("player")) do outputChatBox("Message here", v, 0, 0, 0) -- change 0,0,0 to your colors. end I have been doing it like that in my scripts before without issue Link to comment
xXMADEXx Posted February 22, 2014 Share Posted February 22, 2014 It still takes more than to just use getRootElement, and root is a lot faster to write. Link to comment
Bonsai Posted February 22, 2014 Share Posted February 22, 2014 Why would anyone use a loop to get this done.. Thats what the visibleTo argument was made for.. Loop might be an alternative way, but its stupid. Link to comment
TheCapn Posted February 27, 2014 Author Share Posted February 27, 2014 It can be useful If we want to send a special message to each kind of player, I guess 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