i need to put a colour for example when i say something it would be in red this is the script so far:
local chatRadius = 25 --units
function sendMessageToNearbyPlayers( message, messageType )
if messageType == 1 then
local posX, posY, posZ = getElementPosition( source )
local chatSphere = createColSphere( posX, posY, posZ, chatRadius )
local nearbyPlayers = getElementsWithinColShape( chatSphere, "player" )
destroyElement( chatSphere )
for index, nearbyPlayer in ipairs( nearbyPlayers ) do
outputChatBox( message, nearbyPlayer )
end
end
end
addEventHandler( "onPlayerChat", getRootElement(), sendMessageToNearbyPlayers )
function blockChatMessage()
cancelEvent()
end
addEventHandler( "onPlayerChat", getRootElement(), blockChatMessage )
function onChat ( message, messageType )
if messageType == 0 then
local root = getRootElement()
outputChatBox ( getPlayerName ( source ) .. .. message, getRootElement(), true )
cancelEvent()
end
end
addEventHandler ( "onPlayerChat", getRootElement(), onChat )See Also