Script crashing the whole studio

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

Are you saying that if you set this script to Disabled, then Studio no longer crashes?

Yes, but inside that script I can’t find anything that breaks the code, plus theres some pcalls. When I activate the script it gives an error in the ChatMain script of the CoreScripts.

Which obviously has nothing to do your leaderstat Datastore script. Unusual

Quick question. Did you mean to name the folder “Leaderstats” on purpose, so that it didn’t appear in the CoreGui, or did you mean to call it “leaderstats” so it would appear?

I don’t want the stats to be displayed in CoreGui that’s why it’s in capital letters.

Anyways, maybe the error i get is because an internal studio error