the error is on the last line. it says "expected identifier, got ')' please help me
SmoothBlockModel = script.Parent
game.Players.PlayerAdded:connect(
function(player)
local ls = Instance.new("IntValue",plr)
local leaderstats = Instance.new("Model")
leaderstats.Name = "leaderstats"
leaderstats.Parent = player
local money = Instance.new("IntValue")
money.Name = "Score"
money.Value = 0
money.Parent = leaderstats
end)
SmoothBlockModel.Touched:Connect(function(hit)
for _, player in ipairs()(game.Players:GetPlayers()) do
player.leaderstats.Score.Value = player.leaderstats.Score.Value + 1
wait(1)
end)

1 comment
Add an 'end' between line 17 and 18. You never ended the for loop, so the script read it wrong.