local DataStore = game:GetService(“DataStoreService”)
local Mission = DataStore:GetDataStore(“Mission”)
game:GetService(“ReplicatedStorage”).DetectPlayer.OnServerEvent:Connect(function(x,plr)
local leaderstats = Instance.new(“Folder”,plr)
leaderstats.Name = “leaderstats”
local missioncomplate = Instance.new(“NumberValue”,leaderstats)
missioncomplate.Name = “Mission”
if Mission:GetAsync(“Mission”…plr.UserId) then
missioncomplate.Value = Mission:GetAsync(“Mission”…plr.UserId,missioncomplate.Value)
else
missioncomplate.Value = 0
end
end)
game.Players.PlayerRemoving:Connect(function(plr)
local missioncomplate = plr.leaderstats.Mission
Mission:SetAsync(“Mission”…plr.UserId,missioncomplate.Value)
end)
my problem: Not saving.