You can write your topic however you want, but you need to answer these questions: 1. What do you want to achieve? Keep it simple and clear!
i want the script to clone the template into the scrolling frame when the player joins with the template name being the player’s name
2. What is the issue? Include screenshots / videos if possible!
The issue is that the template isnt cloning into the scrolling frame
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
it needs to be the exact username of the player.
Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.
You’d need a localscript for that (StarterPlayer > StarterPlayerScripts in explorer)
local plr = game.Players.LocalPlayer
for i, v in pairs(game.Players:GetChildren()) do
if v.Name ~= plr.Name then
local clone = template:Clone()
clone.Parent = plr.PlayerGui.DevCMDS.MainFrame.PlayerList
clone.Name = v.Name
end
end
after this is set up, we need to have a function:
--this will update the gui once a player is added
game.Players.ChildAdded:Connect(function(child)
local clone = template:Clone()
clone.Parent = plr.PlayerGui.DevCMDS.MainFrame.PlayerList
clone.Name = child.Name
end)
--and this will update it when a player is removed/leaves
game.Players.ChildRemoved:Connect(function(child)
plr.PlayerGui.DevCMDS.MainFrame.PlayerList[child.Name]:Destroy()
end)
You need to add all of them, the for i, v in pairs and the other 2 childadded and childremoved events. This is the only script you need for this system. Also remember to define the template.