Ok so, as you seen in the title the is a problem at this script, can you pls help me with it? ERROR: ServerScriptService.Stats:7: Expected ')' (to close '(' at line 6), got 'local'
local players = game:GetService("Players") local datastore = game:GetService("DataStoreService") local ds1 = datastore:GetDataService("ClickData") local ds2 = datastore:GetDataService("RebirthData")
players.PlayerAdded:connect(funtion(player) local folder = Instance.new("Folder") folder.name = "leaderstats" folder.Parent = player local folder2 = Instance.new("Folder") folder2.Name = "Stats" folder2.Parent = players
local currency1 = Instance.new("NumberValue")
currency1.Name = 'Clicks'
currency1.Parent = player.leaderstats
currency1.Value = ds1:GetAsync(player.UserId) or 0
local currency2 = Instance.new("NumberValue")
currency2.Name = 'Rebirths'
currency2.Parent = player.leaderstats
currency2.Value = ds2:GetAsync(player.UserId) or 0
end)

6 comments
Could you please fix the code block? It's really hard to read it this way.
local players = game:GetService("Players") local datastore = game:GetService("DataStoreService") local ds1 = datastore:GetDataService("ClickData") local ds2 = datastore:GetDataService("RebirthData") players.PlayerAdded:connect(funtion(player) local folder = Instance.new("Folder") folder.name = "leaderstats" folder.Parent = player local folder2 = Instance.new("Folder") folder2.
It don't let me type it all Idk how to fix it
Nvm fixed it but becarful when reading it XD
With fixing I meant putting all the code in one lua block. It's all over the place now and it's pretty hard to read it this way.
You have a syntax error somewhere, specifically, a parentheses that is not closed