This is my leaderboard code and I am trying to figure out a way to have points given to someone who is touching a part.
local DataStoreService = game:GetService("DataStoreService")
local DataStore = DataStoreService:GetDataStore("MoneyStats")
game.Players.PlayerAdded:Connect(function(Player)
local Leaderstats = Instance.new("Folder")
Leaderstats.Name = "leaderstats"
Leaderstats.Parent = Player
local Points = Instance.new("IntValue")
Points.Name = "Points"
Points.Value = DataStore:GetAsync(Player.UserId) or "0"
Points.Parent = Leaderstats
end)
game.Players.PlayerRemoving:Connect(function(Player)
DataStore:SetAsync(Player.UserId, Player.leaderstats.Points.Value)
end)

2 comments
You have something at the end of Leaderstats.Parent = Player. Just want to make sure that that's not a part of the Script.
Yeah. it's not.