goodiewarrior Posted April 23, 2016 Share Posted April 23, 2016 Hello, in my server there's a key (F2) which sends an outputChatBox to rootElement with your Stats. I want to add this: when you join the server, you've to choose between two images (SECTION1 and SECTION2). I want to do that ONLY SECTION1 players (let's use getElementData) receive this outputChatBox, but SECTION2 don't. How could I do this? Link to comment
goodiewarrior Posted April 25, 2016 Author Share Posted April 25, 2016 Post the code. Not needed, I have just a GUI to choose Section1 and 2. I want to do that if the player is Section1, he gets the outputChatBox. Maybe a loop? But I dunno how to do it. Link to comment
goodiewarrior Posted April 25, 2016 Author Share Posted April 25, 2016 Post the code. Not needed, I have just a GUI to choose Section1 and 2. I want to do that if the player is Section1, he gets the outputChatBox. Maybe a loop? But I dunno how to do it. Link to comment
goodiewarrior Posted July 3, 2016 Author Share Posted July 3, 2016 Clear English please. I think I was very clear... I want to send an outputChatBox only to the users who have some certain elementData value, others cannot see the outputchatbboz Link to comment
Captain Cody Posted July 3, 2016 Share Posted July 3, 2016 if getElementData(player,"Test") == true then -- "Test" -> Set your element data here outputChatBox("TEST") -- > Set your text Here end Link to comment
Captain Cody Posted July 3, 2016 Share Posted July 3, 2016 if getElementData(player,"Test") == true then -- "Test" -> Set your element data here outputChatBox("TEST",player) -- > Set your text Here end Link to comment
KariiiM Posted July 3, 2016 Share Posted July 3, 2016 Putting this code dirrectly in the server side will not work correctly, you'll have to define the player element else the entire code will be failed to load. Link to comment
goodiewarrior Posted July 3, 2016 Author Share Posted July 3, 2016 I think I gotta use a loop with all players and make an IF check? Like Teamsay. Link to comment
KariiiM Posted July 3, 2016 Share Posted July 3, 2016 I think I gotta use a loop with all players and make an IF check?Like Teamsay. Depends on what you are planning to do. Link to comment
Captain Cody Posted July 3, 2016 Share Posted July 3, 2016 KariiiM, I put that assuming he would know how to do it. Any ways function join () for i,player in pairs(getElementsByType("player") do if getElementData(player,"Test") == true then -- "Test" -> Set your element data here outputChatBox("TEST",player) -- > Set your text Here end end end addEventHandler ( "onPlayerJoin", getRootElement(), join ) Link to comment
KariiiM Posted July 3, 2016 Share Posted July 3, 2016 KariiiM, I put that assuming he would know how to do it. Yes Codly, I was just reminding him that's all. By the way, this line number '2' is going to output an error, you forgot to add an ')' before do for i,player in pairs(getElementsByType("player") do for _, player in ipairs ( getElementsByType ( "player" ) ) do Link to comment
Captain Cody Posted July 4, 2016 Share Posted July 4, 2016 Ah yes, always make that mistake, for some reason notepad ++ automaticly changes that to a single ) instead of both. 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