Hello there, I have a complicated situation here where I want to make a StringValue change it's value to the player's name that joined, I don't really know on how to approach this because I can only think of all of the StringValues copying the player's name that joined instead of one player only for one StringValue only
I also want to do this for the second player that joins the server, where the second StringValue changes it's value to the second player's name that joined the server, also occuring with the other 4 StringValues, how does one do this?
local Players = game:GetService("Players")
local plr1 = game.Workspace.PlayerStrings.Player1
local plr2 = game.Workspace.PlayerStrings.Player2
local plr3 = game.Workspace.PlayerStrings.Player3
local plr4 = game.Workspace.PlayerStrings.Player4
local plr5 = game.Workspace.PlayerStrings.Player5
local plr6 = game.Workspace.PlayerStrings.Player6
local function onPlayerAdded(player)
plr1.Value = player.Name
plr2.Value = player.Name
plr3.Value = player.Name
plr4.Value = player.Name
plr5.Value = player.Name
plr6.Value = player.Name
end
for _, player in pairs(Players:GetPlayers()) do
onPlayerAdded(player)
end
Players.PlayerAdded:Connect(onPlayerAdded)

1 comment
if u absolutely must do it this way, tables are ur best friend :)