Okay, so basically I tried making a leaderboard script and I cannot fix it at the moment. Its not an localscript its a regular script and I dont understand how its not working. Its 100% broken right now.
local DataStore = game:GetService("DataStoreService")
local CashStore = DataStore:GetDataStore("CashStore")
local RebirthStore = DataStore:GetDataStore("RebirthStore")
local StageStore = DataStore:GetDataStore("StageStore")
game.Players.PlayerAdded:Connect(function(player)
local stats = Instance.new("Folder",player)
stats.Name = "leaderstats"
local cash = Instance.new("IntValue",stats)
cash.Name = "Cash"
cash.Value = CashStore:GetAsync(player.UserId) or 0
print("Data Loaded.")
local rebirths = Instance.new("IntValue",stats)
rebirths.Name = "Rebirths"
rebirths.Value = RebirthStore:GetAsync(player.UserId) or 0
print("Data Loaded")
local stage = Instance.new("IntValue",stats)
stage.Name = "Stage"
stage.Value = StageStore:GetAsync(player.UserId) or 0
print("Data Loaded")
end)
game.Players.PlayerRemoving:Connect(function(player)
CashStore:SetAsync(player.UserId,player.leaderstats.Cash.Value)
print("Data Saved.")
end)?
game.Players.PlayerRemoving:Connect(function(player)
RebirthStore:SetAsync(player.UserId,player.leaderstats.Rebirths.Value)
end)
game.Players.PlayerRemoving:Connect(function(player)
StageStore:SetAsync(player.UserId,player.leaderstats.Stage.Value)
end)

2 comments
Where the hell did all those end)’s come from?!
Also don’t use AlvinBlox, or free Scripts, they’re very deprecated