I was making a memory script and when I do the command it gives me the error shown in the title.
My Script:
Players = game:GetService("Players")
RS = game:GetService("ReplicatedStorage")
local cmd = "/memory "
function runFilter(msg, uid)
local ftr = game:GetService("TextService"):FilterStringAsync(msg, uid)
if ftr then
return ftr:GetNonChatStringForUserAsync()
end
return ""
end
Players.PlayerAdded:connect(function(player)
player.Chatted:connect(function(message)
local tp = player.data.tp.Value
if tp == 0 then
return
end
if string.match(message, cmd) then
local split = string.split(message, cmd)
local msg = split[2]
if msg then
local log = RS.Memories:FindFirstChild(tp)
if not log then
log = Instance.new("StringValue")
log.Parent = RS.Memories
log.Name = tp
end
local success, emsg, fmsg = pcall(runFilter, msg, player.UserId)
log.Value = ""..fmsg.."\n-"..player.Name
print("New memory in "..tp..": "..fmsg)
end
end
end)
end)