Why did it says I have no data?

Hello, the lost people,

I’m trying to make a piggy-style game using @GnomeCode’s script. It will kick you if you don’t have the session data. I tried to make it didn’t use StarterCharacter. But it keep kicking me. Please help ;-;

Code
local function LoadData(player)
	DataSetup(player)
	wait(4)
	local success, data
	local tries = 0
	repeat
		tries = tries + 1
		success, data = pcall(function()
			return playerData:GetAysnc(player.UserId)
		end)
		if not success then
			wait(1)
		end
	until tries == 3 or success
	
	if success then
		if data then
			if not data["trap"] then
				data["trap"] = "Default"
				data["traps"] = {"Default"}
			end
			
			sessionData[player.UserId] = data
		else
			sessionData[player.UserId] = {
				tickets = 0,
				trap = "Deafult",
				traps = {
					"Default"
				},
				
				killer = "Clare",
				characters = {
					"Clare"
				}
			}
		end
		
		AvatarSetup(player)
		player.Tickets.Value = sessionData[player.UserId].tickets
	else
		togglePopup:FireClient(player, "Failed to load your data", false)
		warn("Failed to load", player, "'s data")
	end
end

is https on?

thats probally the problem

There is no kick() in the code? DId you supply us the wrong code or is the kicking another issue?

Also; @InPhulze, to use DataStoreService in Studio you need API services enabled, not HTTP. Just to clarify.

My bad, thanks for the clarify :+1:

And yes, as @mrclevereli said, there is only a warn(), so you shouldn’t be getting kicked

1 Like