#dont know why it wont make another person in my leaderboard
117 messages · Page 1 of 1 (latest)
local script?
yea thats why
change to server and see if it works
do i gota delete everything that says local too?
no
might want to look into https://create.roblox.com/docs/reference/engine/classes/UIListLayout
this doesn't quite work the way you want it to logically
currently it copies the name UI element and just keeps it in the same position with a different Name and not text
unless it's a surfaceUI, no
it gets all the players and puts them onto a list the script type doesnt matter
oh okay
whoops
im still learning coding
lowkie js rewrote the whole thing
local players = game.Players:GetChildren()
local named = script.Parent.PlayerList.Frame
while true do
for i,v in pairs(players) do
local name = named:Clone()
name.Parent = script.Parent.PlayerList.Frame.ScrollingFrame
name.names.Text = v.Name
end
wait(1)
for i,v in pairs(script.Parent.PlayerList.base.ScrollingFrame:GetChildren()) do
if v:Isa("Frame") then
v:Destroy()
end
end
end
pairs(players)```
my names not showing up now
PlayerAdded and PlayerRemoving events are meant for that
a while true loop will just make it messy
and constantly be active
yea sorry,
can you give me an ss of the gui itself
the way ur script is constructed is making a bunch of clones of textlabels ofplayer names if i understand correctly
bruh what do i do than im s confused
I get the idea but Im confused about the names text thing
this script runs only once tho if the code sent here is the whole script
its not even puting my name up there
ok so you jsut want a list of the players names right?
ya
wait
are you putting all the names into 1 textLabel
or creating new ones in a vertical manner?
ok but first before i do that how come my names not even showing up?
first add a print check
after the for i,v in pairs(players) do add print(i,v)
and see if it prints anything
oh nvm
the table is just empty
replace the first line with
local players = game:GetService("Players")```
i did
i havent shown the script again mbv
local players = game:GetService("Players")
local named = script.Parent.PlayerList.Frame
while true do
for i,v in pairs(players) do
local name = named:Clone()
name.Parent = script.Parent.PlayerList.Frame.ScrollingFrame
name.names.Text = v.name
end
wait(5)
for i,v in pairs(script.Parent.PlayerList.base.ScrollingFrame:GetChildren()) do
if v:Isa("Frame") then
v:Destroy()
end
end
end
pairs(players)```
ehh
second
local Players = game:GetService("Players")
local named = script.Parent.PlayerList.Frame
while true do
for _,playerName in game.Players:GetChildren() do
local name = named:Clone()
name.Parent = script.Parent.PlayerList.Frame.ScrollingFrame
name.names.Text = playerName.name
end
wait(5)
for i,v in script.Parent.PlayerList.base.ScrollingFrame:GetChildren() do
if v:Isa("Frame") then
v:Destroy()
end
end
end
is it meant to be like that 👀
nope!
no clue what you got going over there man with the ui
see were the lable is theres were the names sup to be
did you reference the label correctlyt in the script?
how do i make sure it has more than 1 name
now you gotta remake the whole script cause that while true do is ugly
gotta make new Frame's
one for each person
i did i used my old script i showed i js changed a few things around in explorer
local players = game:GetService("Players")
local named = script.Parent.PlayerList.Frame.ScrollingFrame.names
local function PlayerName(players)
for i,v in pairs(game.Players:GetPlayers()) do
named.Text = v.Name
for i=1,25 do
local clonedObject = named:Clone()
clonedObject.Name = "clone"..i
if named.Text == v.Name then
named:Clone().Text = v.Name
end
end
end
end
PlayerName(players)```
now how do i clone it so everytime someone joins it clones and there names there
you could detect when players join and leave so it adds and removes them from the list with game.Players.PlayerAdded and game.Players.PlayerRemoving
why frames though. why not jsut text labels
local Players = game:GetService("Players")
local ExampleFrame = script.Parent.PlayerList.Frame.ScrollingFrame.names
local function createNewFrame(PlayerName)
local newFrame = ExampleFrame:Clone()
newFrame.Text = PlayerName
newFrame.Name = PlayerName.."Frame"
newFrame.Position = ...
end
local function deleteFrame(PlayerName)
ExampleFrame.Parent[PlayerName.."Frame"]:Destroy()
end
for _,playerName in game.Players:GetPlayers() do -- ran once whenever YOUR player joins the game
createNewFrame(playerName)
end
Players.PlayerAdded:Connect(function(Player) -- ran once a new player joins
createNewFrame(Player)
end)
Players.PlayerRemoving:Connect(function(Player) -- ran once a player leaves
deleteFrame(Player)
end)
something like this
can be that oto
too
depends on what he's using
fair
woild this work
yes and no
it works, but not in the way that you want it to
you need a list of players
this just replaces the current labels text with the new player
and keeps the one singular label
what if i make more than 1 lable
gotta do it similar to this then
there's honestly no easy path for this
if you try to take it then it'll just come out horrible
what does the ..