I am using the proximity-chat script provided by roblox
^In that post,
local TextChatService = game:GetService("TextChatService")
local Players = game:GetService("Players")
local generalChannel : TextChannel = TextChatService:WaitForChild("TextChannels").RBXGeneral
local function getPositionFromUserId(userId)
local targetPlayer = Players:GetPlayerByUserId(userId)
if targetPlayer then
local targetCharacter = targetPlayer.Character
if targetCharacter then
return targetCharacter:GetPivot().Position
end
end
-- return default position for example
return Vector3.new(0, 0, 0)
end
generalChannel.ShouldDeliverCallback = function(textChatMessage: TextChatMessage, targetTextSource: TextSource)
local sourcePos = getPositionFromUserId(textChatMessage.TextSource.UserId)
local targetPos = getPositionFromUserId(targetTextSource.UserId)
-- If the distance between players is less than 50, deliver the message.
return (targetPos - sourcePos).magnitude < 50
end
Here is the server script, is it parented to server script service.
My question about this is, while the script works perfectly fine, as seen is this screenshot
Developer Forum | Roblox
Hi everyone, As part of our continued investment into TextChatService, we’re excited to announce new developer capabilities! Chat Window Customization To allow you to best customize the default chat window to fit your experience’s aesthetic and UI layout, we’ve introduced several new properties to the ChatWindowConfiguration instance, parente...
** You are now Level 7! **