PointData = game:GetService("DataStoreService"):GetDataStore("PointData") RebirtData = game:GetService("DataStoreService"):GetDataStore("RebirthData") game.Players.PlayerAdded:Connect(function(plr) local LB Instance.new ("IntValue") LB.Name "leaderstats" LB.Parent = plr local p = Instance.new ("IntValue") p.Name = "Points" p.Parent = LB P.Value = PointData:GetAsync(plr.userId)or 0 end) local r = Instance.new ("IntValue") r.Name = "Rebirths" r.Parent = LB r.Value = RebirthData:GetAsync(plr.userId)or 0 end) game.Players.PlayerRemoved:Connect(function(plr) PointData:SetAsync(plr.userId, plr.leaderstats.Points.Value) RebirtData:SetAsync(plr.userId, plr.leaderstats.Rebirths.Value)
Hope I helped :] you made typos
PointData = game:GetService("DataStoreService"):GetDataStore("PointData") RebirthData = game:GetService("DataStoreService"):GetDataStore("RebirthData") plr = game.Players.LocalPlayer game.Players.PlayerAdded:Connect(function(plr) local LB Instance.new ("IntValue") LB.Name "leaderstats" LB.Parent = plr local p = Instance.new ("IntValue") p.Name = "Points" p.Parent = LB p.Value = PointData:GetAsync(plr.userId)or 0 --[[P or p ? lua is case sensitive]] local r = Instance.new ("IntValue") r.Name = "Rebirths" r.Parent = LB r.Value = RebirthData:GetAsync(plr.userId)or 0 end) --[[what is PlayerRemoved ? maybe u want .PlayerRemoving:]] game.Players.PlayerRemoved:Connect(function(plr) PointData:SetAsync(plr.userId, plr.leaderstats.Points.Value) RebirthData:SetAsync(plr.userId, plr.leaderstats.Rebirths.Value) end)