Setting up leaderstats isn't working?

Yo

Gonna make this nice and simple, I write this script:

local DataStoreService = game:GetService("DataStoreService")
local TokenStore = DataStoreService:GetDataStore("TokenStore")

game.Players.PlayerAdded:Connect(function(plyr)
	local leaderstats = Instance.new("Folder")
	leaderstats.Parent = plyr
	leaderstats.Name  = "leaderstats"
	
	local tokens = Instance.new("IntValue")
	tokens.Parent = leaderstats
	tokens.Name = "Tokens"
	
	local inGame = Instance.new("BoolValue")
	inGame.Name = "inGame"
	inGame.Parent = plyr
	
	local isVIP = Instance.new("BoolValue")
	isVIP.Name = "isVIP"
	isVIP.Parent = plyr
	isVIP.Value = true
	
	local tokenData
	local success, errormessage = pcall(function()
		tokenData = TokenStore:GetAsync(plyr.UserId.."-tokens")
	end)
	
	if success then
		tokens.Value = tokenData
	else
		print("There was an error when getting this users data")
		warn(errormessage)
	end
end)

game.Players.PlayerRemoving:Connect(function(plyr)
	local success, errormessage = pcall(function()
		TokenStore:SetAsync(plyr.UserID.."-tokens",plyr.leaderstats.Tokens.Value)
	end)
	
	if success then
		print("Player data saved")
	else
		print("Player data FAILED to save")
		warn(errormessage)
	end
end)

and it works fine in studio. Sure, the DataStores don’t work, but it’s a DataStore in studio, but when I run it in game, I don’t even get any leaderstats whatsoever
image

Here’s the in-game errormessages.


Do note that the other two error messages are dependent on the leaderstats to actually function lol

Leaderstats in studio for those who need to see that it does indeed work there:
image

(Yes i have ran publish multiple times but when run in game I keep getting the same results)

UPDATE

After tinkering around, I found a fix. It turns out simply removing the part of setting the isVIP value to true is enough to break the leaderstats. Dunno why, but it worked lol