I'm trying to make a script where you can shout if you want more people to hear what you are saying. The problem is no matter what I say only the first part displays.
Like if I try to say: "/s Hey what are you doing?" It comes back as HEY!
function shout( source, command, ... )
outputDebugString ( ... , 1)
local message = table.concat( {...}, " " )
outputDebugString ( ... , 1)
outputChatBox(..., source)
local x, y, z = getElementPosition(source)
local radius = createColSphere(x, y, z, 100)
local nearplayers = getElementsWithinColShape(radius, "player")
destroyElement(radius)
for _, player in ipairs(nearplayers) do
if getElementDimension(player) == getElementDimension(source) then
local chatter = pregReplace( getPlayerName(source), '_', ' ' )
outputChatBox(..., player, 255, 255, 255, true)
local MESSAGE = string.upper( ... )
outputChatBox(chatter..' ordítja: '..MESSAGE, player, 255, 255, 255, true)
end
end
end
addCommandHandler ( "s", shout)
What could be the problem?