Hi yall! I have a problem with my own script when I am trying to make a chat-bot. The other problems I have solved by using a remote event inside of the remote function to fire to every single client, but whenever I filter the chatmsg text it gives me the error: Localscript Line 7; attempt to concatentate a nil value.
Here is my LocalScript.
local msg = script.Parent.Parent.TextBox script.Parent.MouseButton1Click:Connect(function() game.ReplicatedStorage.RemoteFunction:InvokeServer(msg.Text) end) game.ReplicatedStorage.RemoteEvent.OnClientEvent:Connect(function() game:GetService("StarterGui"):SetCore("ChatMakeSystemMessage",{ --Getting "StarterGui" and calling the function ---*No Touchy* Text = "[Fro-Bot]: "..game.ReplicatedStorage.RemoteFunction:InvokeServer(msg.Text); ----Allowed to put in player name and Message Color = Color3.new(255/255, 255/0, 0/0); -----Allowed to Change Color FontSize = Enum.FontSize.Size24; ----*No Touchy* }) end)
and then here is my remote function aka server script
local TextService = game:GetService("TextService") game.ReplicatedStorage.RemoteFunction.OnServerInvoke = function(player,chatmsg) local TextFilterResult = TextService:FilterStringAsync(chatmsg,player.UserId) game.ReplicatedStorage.RemoteEvent:FireAllClients() return TextFilterResult end
The problem is in the localscript, at line 7 Thank you guys for your help, much appreciated! ;)