Hi devs! I currently making a game where it shows players list on a part. But I ran into this problem. Could you guys tell me what is the problem with the script?
What do you want to achieve? Keep it simple and clear!
I want to know that whats the issue of the script
What is the issue? Include screenshots / videos if possible!
Players list not working on surface GUIs
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I looked for it in the dev hub but it didnt help me much
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!
Code for surfacegui:
function temp(plrname)
local clone = script.Parent.ScrollingFrame.Playername:Clone()
clone.Text = plrname
clone.Name = plrname
clone.Parent = script.Parent.ScrollingFrame
clone.Visible = true
end
game.ReplicatedStorage.AddPlayer.OnClientEvent:Connect(function(plrname)
temp(plrname)
end)
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.
I’m assuming you want to add the players name to the list when they join the game like the default playerlist.
If I’m correct you could just put a normal script in ServerScriptService (or anywhere else on the server), and use Player.PlayerAdded:connect()/Player.PlayerRemoving:connect() to know when to add/remove the Players username to/from the list. Then you could simply put the Playername textlabel in the script, and clone it into the list by doing something like
local ListReference = game.Workspace:WaitForChild("PlayerList")
local PlayerNameText = Playername:Clone()
PlayerNameText.Parent = ListReference.SurfaceGui.ScrollingFrame
I hope I understood you correctly, and that this helps at least a little.