game.Players.PlayerAdded:Connect(function(player)
local UserInputService = game:GetService("UserInputService")
local leaderstats = Instance.new("Folder", player)
local Respect = Instance.new("IntValue", leaderstats)
leaderstats.Name = "leaderstats"
Respect.Name = "Respect"
end)
game.ReplicatedStorage.GiveRespect.OnServerEvent:Connect(function(plr)
plr.leaderstats.Respect.Value = plr.leaderstats.Respect.Value + 1
end)
I want to turn this into a datastore so it saves. How would I go about doing that

3 comments
Is there a reason you aren’t making a leaderboard and a save system in the same script?
I wanted to make it in the same script, thats why I posted the script
Ah, my bad. I misunderstood the title