script.Parent.MouseButton1Click:connect(function(p)
local m = script.Parent.Name
game.Workspace.mapvals.m.Value = game.Workspace.mapvals.m.Value + 1
script.Parent.Parent.Visible = false
end)
the scripts parent's name changes according to the value i want to add 1 to. in the output it says:
M is not a valid member of Folder
the folder contains the values. so how do i have it add to the value that has the same name as the scripts parent's name?

3 comments
so theres no way to do this with the actual name it has? becuase i have alot of names for the image button that are going to change.
thank you
No problem.