-
What do you want to achieve? I want to insert a variable into a table so that I can change its value in the future
-
What is the issue? i dont know how to do it
-
What solutions have you tried so far? my searches in the answer were not successful
players = {
}
game:GetService("Players").PlayerAdded:Connect(function(player)
for i,v in ipairs(game:GetService("Players"):GetChildren()) do
if v == player then
table.insert(players, table.create(i, v))
--i want "Hero" to be variable
table.insert(players[i], "Hero")
for i,v in ipairs(players[i]) do
if i == 2 then
print(v)
end
end
print(players)
end
end
end)