Jump to content

onPlayerChat Problem


gokalpfirat

Recommended Posts

When i use

function hideJack(player,command,who,...) 
  local targetPlayer = getPlayerFromName ( who ) 
    local r, g, b = getPlayerNametagColor ( player ) 
        local hexColor = string.format ( "#%02X%02X%02X", r, g, b ) 
  if targetPlayer then 
    local message = table.concat({...}, " ") 
    outputChatBox(getPlayerName(targetPlayer )..""..hexcolor..":"..message ,root,255,255,255,true) 
  end 
end 
addCommandHandler("yaziasda",hideJack) 

I get chat/server.lua:40 attempt to concetenate global 'hexcolor' (a nil value)

Link to comment

Because it's hexColor not hexcolor

function hideJack(player,command,who,...) 
  local targetPlayer = getPlayerFromName ( who ) 
    local r, g, b = getPlayerNametagColor ( player ) 
        local hexColor = string.format ( "#%02X%02X%02X", r, g, b ) 
  if targetPlayer then 
    local message = table.concat({...}, " ") 
    outputChatBox(getPlayerName(targetPlayer )..""..hexColor..":"..message ,root,255,255,255,true) 
  end 
end 
addCommandHandler("yaziasda",hideJack) 

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