What do you think caused the players to have their Parkour level reset?
Not entirely sure, might be that their levels did not save properly when they left. Might be a good idea to implement an auto save feature (maybe save the data every minute or two)
In the following video, if you look closely, you can see that when I die I appear for 1 millisecond in the air, and then I just appear in my level. Do you know how to remove that or what causes it?
That is supposed to happen, your character loads and since there is no spawn location you load mid air and then get teleported to your stage.
Is there any way that when I die I donât immediately reappear in my level? For example, I would like that when I die it takes 0.5 seconds to reappear and that it is not immediate.
But then, the script I have doesnât have that automatic save every 2min, so how often is the progress of the players saved in this script you gave me?
Oh I understand, I just saw that other parkours didnât have that problem, but itâs not such a big problem.
But then, the script I have doesnât have that automatic save every 2min, so how often is the progress of the players saved in this script you gave me?
It only saves when the player leaves. If you want to save player data every minute, just add:
local save = coroutine.create(function()
while wait(60) do
savePlrData(plr)
end
end)
coroutine.resume(save)
Well, I donât know, I want to know if Iâm doing what youâre telling me right. Here is the code anyway:
local players = game:GetService("Players")
local dataStoreService = game:GetService("DataStoreService")
local saveDataStore = dataStoreService:GetDataStore("SaveDataTest")
local function savePlrData(plr)
local success,err = pcall(function()
local saveData = {}
for _,stat in pairs(plr.leaderstats:GetChildren())do
saveData[stat.Name] = stat.Value
end
saveDataStore:SetAsync(plr.UserId,saveData)
end)
if not success then return err end
end
players.PlayerAdded:connect(function(plr)
local stats = Instance.new("Folder")
stats.Name = "leaderstats"
stats.Parent = plr
local stage = Instance.new("IntValue")
stage.Name = "Stage"
stage.Parent = stats
local data = saveDataStore:GetAsync(plr.UserId)
if data then
print(data.Stage)
for _,stat in pairs(stats:GetChildren()) do
stat.Value = data[stat.Name]
end
else
print(plr.Name .. " has no data")
end
wait(workspace.ObbyStages:WaitForChild(stage.Value))
local start = workspace.ObbyStages:WaitForChild("0")
plr.CharacterAdded:connect(function(char)
wait()
if stage.Value == 0 then
local destination = start.CFrame + Vector3.new(0,3,0)
char:SetPrimaryPartCFrame(destination)
else
local part = workspace.ObbyStages:FindFirstChild(stage.Value)
local destination = part.CFrame + Vector3.new(0,3,0)
char:SetPrimaryPartCFrame(destination)
end
char.Humanoid.Died:Connect(function()
wait(0.5)
plr:LoadCharacter()
end)
end)
plr:LoadCharacter()
local save = coroutine.create(function()
while wait(60) do
savePlrData(plr)
end
end)
coroutine.resume(save)
end)
players.PlayerRemoving:connect(function(plr)
local err = savePlrData(plr)
if err then print(err) end
end)
game:BindToClose(function()
for _,plr in pairs(players:GetPlayers()) do
local err = savePlrData(plr)
if err then print(err) end
end
end)
It is that, you tell me to add something to the script so that the saving of the levels is every minute, then I want to know if I am doing it right.
Using HumanoidRootPartis the way to make sure that your scripts work for both R6 and R15. Using Torso, for example, will only work on R6, and using UpperTorso will only work on R15. HRP is what I always recommend using, as thereâs not really any advantage to using Torso.
local function savePlrData(plr)
local success,err = pcall(function()
local saveData = {}
for _,stat in pairs(plr.leaderstats:GetChildren())do
saveData[stat.Name] = stat.Value
end
saveDataStore:SetAsync(plr.UserId,saveData)
end)
if not success then return err end
end
to:
local function savePlrData(plr)
local success,err = pcall(function()
local saveData = {}
for _,stat in pairs(plr.leaderstats:GetChildren())do
saveData[stat.Name] = stat.Value
end
saveDataStore:SetAsync(plr.UserId,saveData)
end)
if not success then return err end
if success then print(plr .. " data has been saved" ) end
end
so it prints out that a playerâs data has been successfully saved, just use this in testing to make sure it saves correctly.
"There is a super mega annoying bug, I was at level 200 and so on, and when I joined now in the afternoon it sent me up to 20 levels behind, and that had already happened to me before, and I had spent robux to give skip in difficult levels and apparently I was scammed because I was 20 levels behind, very bad but very bad."
Do you have any idea what it might be? Iâm really worried about it, as this bug is worse than the previous one that happened.
NO NO NO NO IT DOESNâT HELP, SOMETHING IS WRONG WITH THE SYSTEM, MY SECONDARY ACCOUNT HAD ITS LEVEL RESET, AND WHEN A PLAYER EXITS THE GAME I GET THIS MESSAGE FROM THE CONSOLE: