Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Error; Attempt to concatentate a nil value. Filtering script help??

Asked by 5 years ago
Edited 5 years ago

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! ;)

0
Where is your server script located? At ReplicatedStorage? cailir 284 — 5y
0
No, it is located at ServerScriptService Frometa1998 35 — 5y

Answer this question