Well, theres really nothing more to say about this, this leaderstats script is crashing my studio all the time, And it gives me errors inside the place CoreScripts
GetBlockedUserIds has not been registered by the CoreScripts
--services
local DataStoreService = game:GetService("DataStoreService")
local dataStore = DataStoreService:GetDataStore("playerData")
--functions
game.Players.PlayerAdded:Connect(function(player)
--leaderboard
local leaderstats = Instance.new("Folder")
leaderstats.Name = "Leaderstats"
leaderstats.Parent = player
local Level = Instance.new("IntValue")
Level.Name = "Level"
Level.Parent = leaderstats
local Exp = Instance.new("NumberValue")
Exp.Name = "Exp"
Exp.Parent = leaderstats
--
-- getAsync
local levelData, expData
local success, err = pcall(function()
levelData = dataStore:GetAsync("level-".. player.UserId)
expData = dataStore:GetAsync("exp-".. player.UserId)
end)
if success then
Level.Value = levelData
Exp.Value = expData
else
print("Cannot entablish connection to the dataStore server!")
end
--
end)
game.Players.PlayerRemoving:Connect(function(player)
-- setAsync
local success, err = pcall(function()
dataStore:SetAsync("level-".. player.UserId, player.Leaderstats.Level.Value)
dataStore:SetAsync("exp-".. player.UserId, player.Leaderstats.Exp.Value)
end)
if success then
print("Data saved correctly")
else
print("Cannot save!")
warn(err)
end
--
end)
I appreciate any help