I’m making a game that gives you “Points” the longer you stay in it, but I keep getting flooded with, “Warning: Locale not found ‘’, reverting to ‘en-us’ instead.” and this is only ingame not studio.
this is the only code I have in serverscripservice:
> local DataStoreService = game:GetService("DataStoreService")
> local dataStore = DataStoreService:GetDataStore("LeaderstatDataStore")
>
>
>
> local function saveData(player)
>
> local tableToSave = {}
>
> for i,v in ipairs(player:WaitForChild("leaderstats", 5):GetChildren()) do
> table.insert(tableToSave, v.Value)
> end
>
> local success, erorrmessage = pcall(function()
> dataStore:SetAsync(player.UserId, tableToSave)
> end)
>
>
>
>
> end
>
>
> game.Players.PlayerAdded:Connect(function(plr)
>
> local l = Instance.new("Folder", plr) l.Name = "leaderstats" local p = Instance.new("NumberValue", l) p.Name = "Points" local s = Instance.new("NumberValue", l) s.Name = "Submits"
>
> local data
>
> local success, errormessage = pcall(function()
>
> data = dataStore:GetAsync(plr.UserId)
>
> end)
>
> if success and data then
>
> p.Value = data[1]
> s.Value = data[2]
>
> end
>
> end)
>
> game.Players.PlayerRemoving:Connect(function(plr)
> local success, erorrmessage = pcall(function()
> saveData(plr)
> end)
>
> if erorrmessage then
> -- webhook here
> end
> end)
>
> game:BindToClose(function()
> for _, player in ipairs(game:GetService("Players"):GetPlayers()) do
> local success, errormessage = pcall(function()
> saveData(player)
> end)
>
> if errormessage then
> -- webhook here
> end
>
> end
> end)
>
> while task.wait(0.5) do
> repeat task.wait() until game:GetService("Players"):GetPlayers()
> for i,v in ipairs(game.Players:GetPlayers()) do
> v.leaderstats.Points.Value += 1
> end
> end
```