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