Jump to content

outputChatBox depending setElementData?


Recommended Posts

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
  • 2 months later...

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, 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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...