TheBigC10
(Tbc)
September 17, 2020, 9:34pm
#1
Hello.
So here’s the issue.
When I join the game on my main account, It shows my profile. When I join on my alt account, It just duplicates it and says, Player1. (Which is the text’s GUI.)
But for that alt account it shows my name and their name.
game.Players.PlayerAdded:Connect(function(player)
local Plr = player
local Temp = script.Template:Clone()
Temp.Parent = script.Parent.Parent.ScrollingFrame
Temp.Name = Plr
print("Done. (1/2)")
Temp.PlayerName.Value = Plr
Temp.Plr_Image.LocalScript.Disabled = false
print("Done. (2/2)")
end)
local PLAYERS = game.Players:GetChildren()
for i = 1, #PLAYERS do
local Plr = PLAYERS[i].Name
local Temp = script.Template:Clone()
Temp.Parent = script.Parent.Parent.ScrollingFrame
Temp.Name = Plr
print("Done. (1/2)")
Temp.PlayerName.Value = Plr
Temp.Plr_Image.LocalScript.Disabled = false
print("Done. (2/2)")
end
Thanks!
647AKI
(aki)
September 17, 2020, 9:39pm
#2
Don’t set the name to the ‘Player’, either to do,
Temp.Name = tostring(player)
or
Temp.Name = player.Name
TheBigC10
(Tbc)
September 17, 2020, 9:43pm
#3
That didn’t fix anything on the script. Its still doing the same thing. Lemme send some ss
TheBigC10
(Tbc)
September 17, 2020, 9:44pm
#4
This is AboutGolden’s perspective when he joins second.
647AKI
(aki)
September 17, 2020, 9:44pm
#5
Yeah, that would be more helpful. Kind of hard to understand your issue based on the explanation.
TheBigC10
(Tbc)
September 17, 2020, 9:45pm
#6
This is TheBigC10’s Perspective when he joins first.
KhaosDev
(Khaos)
September 17, 2020, 9:46pm
#7
Would changing that to this help?
local PLAYERS = game.Players:GetPlayers()
TheBigC10
(Tbc)
September 17, 2020, 9:48pm
#8
That will help instead of doing GetChildren(). But im still having the issue. : p
647AKI
(aki)
September 17, 2020, 9:49pm
#9
Why cant you just do a client event, and :FireAllClients it would be much easier. It would look something like this
local player = game.Players.LocalPlayer
ClientEvent.OnClientEvent:Connect(function()
local Template = script.Template:Clone()
Template.NameDisplay = player.Name
Template.AvatarDisplay = player:GetUserThumbnailAsync(player.UserId,Enum.ThumbnailType.HeadShot, Enum.ThumbnailSize.Size420x420)
Template.Parent = ScrollingFrame
end)
--Server
game.Players.PlayerAdded:Connect(function(player)
ClientEvent:FireAllClients(player)
end)
KhaosDev
(Khaos)
September 17, 2020, 9:49pm
#10
Does it print Done 1/2 and Done 2/2 for the 2nd player that joins or no?
KhaosDev
(Khaos)
September 17, 2020, 9:53pm
#11
Actually, try adding a wait(1) or wait(2) before it iterates through everyone in game.
TheBigC10
(Tbc)
September 17, 2020, 9:53pm
#12
It does print both! Must be a weird error.
TheBigC10
(Tbc)
September 17, 2020, 9:54pm
#13
Ill try this! Thank you! (30 Letters!!)
KhaosDev
(Khaos)
September 17, 2020, 9:55pm
#14
Does it print once or twice? Also, it might not work due to both players not being fully loaded in yet so only one player has his/her thing loaded in.
TheBigC10
(Tbc)
September 17, 2020, 9:56pm
#15
Ooh, Ill try to add a wait() line.
TheBigC10
(Tbc)
September 17, 2020, 10:01pm
#16
Its saying this when I join after AboutGolden.
KhaosDev
(Khaos)
September 17, 2020, 10:02pm
#17
What’s line 3? (30 letterssssssssss)
TheBigC10
(Tbc)
September 17, 2020, 10:03pm
#18
print(player.." Is Joining")
That’s line 3.
TheBigC10
(Tbc)
September 17, 2020, 10:03pm
#19
Should I do something like, player.Name?
1 Like
KhaosDev
(Khaos)
September 17, 2020, 10:03pm
#20
Try using player.Name instead of just player