`So I'm currently building a game with a friend and we have a leaderboard system set up where when you click it gives you one picture and you can transfer that into one follower when you step on a platform. All of that works fine and it counts it all perfectly but I am having trouble with the autosave. I've watched many tutorials that show how to save but I am not getting it because I am relatively new to this. Here's the script:
game.Players.PlayerAdded:Connect(function(player)
local stats = Instance.new("Folder")
stats.Name = "leaderstats"
stats.Parent = player
local pictures = Instance.new("IntValue")
pictures.Name = "Pictures"
pictures.Value = 0
pictures.Parent = stats
local followers = Instance.new("IntValue")
followers.Name = "Followers"
followers.Value = 0
followers.Parent = stats
end
Then the script we use to register the clicks onto the leaderboard is:
script.AddPictures.OnServerEvent:Connect(function(player)
player.leaderstats.Pictures.Value = player.leaderstats.Pictures.Value +1
end)
