Hi, I’m a bit confused as to how this works. I’m quite new and am still learning, I was following the dev hub thing page and it sort of works, however when I get it to be displayed on the player it just makes them say ‘Instance’. Here is my code.
local rep = game:GetService("ReplicatedStorage")
local re = rep.ArrestSystems:WaitForChild("ReadArrestRights")
local ChatService = game:GetService("Chat")
local TextService = game:GetService("TextService")
local ArrestRights = "You do not have to say anything. But, it may harm your defence if you do not mention when questioned"
local ArrestRights2 = "something which you later rely on in court. Anything you do say may be given in evidence."
re.OnServerEvent:Connect(function(plr, Reason)
local PlayerChar = plr.Character
local Head = PlayerChar:FindFirstChild("Head")
if Reason == nil then
ChatService:Chat(Head, ArrestRights, Enum.ChatColor.White)
wait(1)
ChatService:Chat(Head, ArrestRights2, Enum.ChatColor.White)
elseif Reason ~= nil then
local plruserid = plr.UserId
local FilteredTextReason = TextService:FilterStringAsync(Reason, plruserid)
ChatService:Chat(Head, FilteredTextReason, Enum.ChatColor.White)
end
end)
It’s only the bottom section past elseif where I’m doing filtering as the other is a preset message.