im new to scripting and ive tried to fix the script and watch youtube videos to learn what i did wrong but i cant figure it out.
local datastoreservice = game:GetService("DataStoreService")
local clicksDataStore = datastoreservice:GetDataService("clicks")
game.players.playerAdded:connect(function(player)
local leaderstats = Instance.new("folder",player)
leaderstats.name = "leaderstats"
local clicks = Instance.new("IntValue",leaderstats)
clicks.name = "clicks"
clicks.value = 0
local playeruserId = "player_"..player.UserId
-- Loading Data
local clicksData
local success, errormessage = pcall(function()
clicksData = clicksDataStore:GetAsync(playeruserId)
end)
if success then
clicks.value = clicksData
end
end)
this is the part that isn't working and I dont know why.

2 comments
Your main problem is use of capitals in game.Players.PlayerAdded. It should be as i just wrote it
Whats says the output?