Jump to content

Help this doesn't work.


Recommended Posts

Did you define the variable; thePlayer in the function? + you can use getRootElement() but its not completely used. You are using thePlayer as a name, so you can also change the getRootElement() to thePlayer or even to source. Cause the source of the event onPlayerJoin/onPlayerLogin = the player element.

Link to comment
Did you define the variable; thePlayer in the function? + you can use getRootElement() but its not completely used. You are using thePlayer as a name, so you can also change the getRootElement() to thePlayer or even to source. Cause the source of the event onPlayerJoin/onPlayerLogin = the player element.

This is the full code:

[lua]

function xD(thePlayer)

local xdd = getPlayerName(thePlayer)

outputChatBox("* " ..xdd.. " MESSAGE",getRootElement(),255,0,0,true)

end

addCommandHandler("OPEN",xD)

Link to comment

function xD(thePlayer)

local xdd = getPlayerName(thePlayer)

outputChatBox("* " ..xdd.. " MESSAGE",getRootElement(),255,0,0,true)

end

addCommandHandler("OPEN",xD)

 

Keep it simple;

 

  
addCommandHandler("open", 
function(source) 
    local playerName = getPlayerName(source); 
    outputChatBox("* ".. playerName .." MESSAGE", source); 
end); 
  

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