I am trying to make a SurfaceGui ScrollingFrame Shop, and this script tell's me there is a error between 12 and 23(Between MouseButton1Click and end. Can anyone tell me how to fix the error?
gather = game.ServerStorage.GearStorage:GetChildren()
scroll = script.Parent.ScrollingFrame
player = script.Parent.Parent.Parent
for i,v in pairs(gather) do
local frame = script.Template:Clone()
frame.Name = v.Value
frame.Parent = scroll
frame.Position = frame.Position + UDim2.new(0,0,0,35*i)
frame.ItemName.Text = v.Value.." | "..v.Price.Value
frame.Purchase.MouseButton1Click:connect(function(c)
if player.globalstats.Points.Value < v.Price.Value then
print(player.Name.." can not afford "..v.Value.."")
else
player.globalstats.Points.Value = player.globalstats.Points.Value - v.Price.Value
local tool = v.Tool:Clone()
tool.Parent = player.Backpack
tool.Name = v.Value
end
end
end)

2 comments
Could you provide the exact error and line?
I did, between 12 and 23. It show's a red line under it and the script doesn't run but there is no error in output.