✓ Accepted answer
Problem
You're not using the value that your iterator (pairs) returns, your v variable. This is the variable that represents the value associated with your i variable (your index variable). All you're doing traversing through a table of objects, assigning a MouseButton1Click event to the same object over and over again (where you have script.Parent.MouseButton1Click).
Solution
What you want to do, is make it so each of the objects you're iterating through gets that MouseButton1Click event. This is pretty easy to accomplish since the value of each individual object is given to you in your v variable as mentioned above.
Now before we just replace script.Parent with v, let's also make sure the object we're working with is a TextButton, so your code doesn't error if there's a different object in your table. For this we'll just add an if statement before creating the event. Here's an example:
local Player = game:GetService("Players").LocalPlayer
local PlayerGui = player:WaitForChild("PlayerGui")
for i,v in pairs(script.Parent:GetChildren()) do
if v:IsA("TextButton") then
v.MouseButton1Click:connect(function()
game.Workspace.Display.LoadedBy.Main.Body.Text = Player.Name
PlayerGui.Training.Trainer.Change.SelectedMap.Text = "Selected map: ".. Player.Name
end)
end
end
Hope that helped, let me know if you have any questions.