local function onPlayerJoin(player)
local leaderstats = Instance.new("Folder")
leaderstats.Name = "leaderstats"
leaderstats.Parent = player
local points= Instance.new("IntValue")
points.Name = "Points"
points.Value = 50
points.Parent = leaderstats
end
game.Players.PlayerAdded:Connect(onPlayerJoin)
-- Script
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local addPointEvent = Instance.new("RemoteEvent", ReplicatedStorage)
addPointEvent.Name = "AddPoint"
local function addPoints(player)
local p = game.Players:FindFirstChild(player.Name)
if p then
p.leaderstats.Points.Value = p.leaderstats.Points.Value + 1
end
end
addPointEvent.OnServerEvent:Connect(addPoints)