above basicly tells you whats going on heres my script...
-- made by popthecorn145
database = game:GetService("DataStoreService")
game.Players.PlayerAdded:Connect(function(p)
repeat wait() until p and p.Character -- repeating wait until player and character loads in
print(p) -- prints the player
points = Instance.new("IntValue") -- makes a new int value called points
points.Name = "Points"
points.Parent = p
points.Value = database:GetDataStore("playerpoints"):GetAsync(p) or 0 -- sets the points value to what is saved or 0
p.PlayerGui.PointsGui.TextLabel.Text = points.Value
points.Changed:Connect(function()
database:GetDataStore("playerpoints"):SetAsync(p,points.Value) -- on points changed it sets the database to the new amount of points
p.PlayerGui.PointsGui.TextLabel.Text = points.Value
end)
end)
