This is the script:
local xs= game:GetService('DataStoreService'):GetDataStore('tester8')
local at = {}
local Players = game.Players
local plr = game.Players.LocalPlayer
local ss = game:GetService('ServerStorage')
local rs = game:GetService('ReplicatedStorage')
local house = rs.house
local price = house.price
local filteringname = rs.filtering.filtername
Players.PlayerAdded:Connect(function(plr)
at[plr] = {}
at[plr].zs = {}
local zs= xs:GetAsync("BOBBY"..plr.UserId)
if zs then
print("loading")
at[plr].zs = zs
local number = at[plr].zs.Okans
price:FireClient(plr,number)
else
print("first join loading base data")
at[plr].zs.Okans = 1000
at[plr].zs.Grade = {50,"B"}
at[plr].zs.furniture = {}
at[plr].zs.Grid = {}
at[plr].zs.Orient = {}
at[plr].zs.skin1 = {}
at[plr].zs.skin2 = {}
at[plr].zs.skin3 = {}
at[plr].zs.ammount = {}
at[plr].zs.name = {plr.Name}
xs:SetAsync("BOBBY"..plr.UserId,at[plr].zs)
local number = at[plr].zs.Okans
price:FireClient(plr,number)
end
end)
local function setname (filteredText)
at[plr].zs.name = {filteredText}
function save()
xs:SetAsync("BOBBY"..plr.UserId,at[plr].zs)
end
local s = pcall (save)
if s then
print('good')
else
print('bad')
end
end
filteringname.OnServerEvent:Connect(function(player,t3xt)
print(player.Name)
local mod = nil
if t3xt ~= "" then
local filteredText = ""
local success, message = pcall(function()
filteredText = game.Chat:FilterStringForBroadcast(t3xt, player)
end)
print(filteredText)
if success then
local hashtag = {"#"}
for i=1,#hashtag do
if filteredText:find(hashtag[i]) then
mod = 'yes'
filteringname:FireClient(mod)
else
mod = 'no'
setname()
print(at[plr].zs.name[1])
filteringname:FireClient(mod)
print('end')
end
end
end
end
end)
(credit to Sebby for the i loop part, thanks sebby! :D)
I have no Idea why this error happens and I've been trying to figure this out for 2 hours.
this is the error by the way : 17:54:26.202 - ServerScriptService.data:87: attempt to index field '?' (a nil value)

6 comments
btw in the full script 87 would be 02
It's hard to solve when I don't exactly know what "at" and "zs" is. What is it? Also is [plr] the player name?
there I fixed it now you can see the full thing
So I don't know a lot about tables, but at line 16, are you trying to insert the player into the "at" table? I usually see numbers in those brackets which are supposed to get something in the table.
Nothing seems wrong. However, if you check if the message is blank, use "not t3xt:match('^%s+$')
Nothing seems wrong. However, if you check if the message is blank, use "not t3xt:match('^%s+$')" to make sure there is no whitespace. Also, please indent correctly.