#"nil" for some reason doesnt show up on 2007 roblox leaderboard gui (no outputs)

1 messages · Page 1 of 1 (latest)

faint trench
#

bro discord for some reason doesnt mark it as lua

#

??

#

module script

local nilJoined = {}

local Players = game:GetService("Players")
local PlayerGui = game:GetService("PlayerGui")
function nilJoined.Trigger()
    for _, player in Players:GetPlayers() do
        local show_nilAttribute = player.PlayerGui.StartGui.tray.Script:GetAttribute("show_nil")
        player.PlayerGui.nilJoined.Enabled = true
        player.PlayerGui.nilMessages.Enabled = true
        show_nilAttribute = 1
    end
end

return nilJoined
#

2007 roblox leaderboard script

function update()
    c = script.Parent:GetChildren()
    for i = 1,#c do
        if string.sub(c[i].Name, 1, 11) == "PlayerLabel" then
            c[i].Visible = false
        end
    end
    for i = 1,#plr do
        item = script.Parent:findFirstChild("PlayerLabel" .. tostring(i))
        if (item~=nil) then
            item.Visible = true
            item.Text = plr[i].Name
        end
    end
end

function getNumber(obj)
    for i = 1,#plr do
        if plr[i]==obj then
            return i
        end
    end
end

plr = {}
p = game.Players:GetChildren()

for i = 1,#p do
    table.insert(plr, p[i])
end

update()
game.Players.ChildAdded:connect(function (guy) table.insert(plr, guy) update() end)
game.Players.ChildRemoved:connect(function (guy) table.remove(plr, getNumber(guy)) update() end)

local show_nilAttribute = script:GetAttribute("show_nil")
if show_nilAttribute == 1 then
    update()
    table.insert(plr, "nil") update()
else
    update()
end
#

"nil" for some reason doesnt show up on 2007 roblox leaderboard gui (no outputs)

#

idk why roblox studio lua acts weird for me

trail lanceBOT
#

studio** You are now Level 11! **studio

summer zenith
#

fym nil doesn't show up

trail lanceBOT
#

studio** You are now Level 14! **studio

summer zenith
#

Peak

faint trench
#

hes supposed to show up in player list

#

with name "nil"

summer zenith
#

So you're making a fake player?

faint trench
#

yeah just for my horror arg game

summer zenith
#

Yeah

#

you can't make players

faint trench
#

bro when i looked in PlayerGui, the attribute "show_nil" isnt set to true (and ive changed those 1 and 0 to true and false)

summer zenith
#

You'll have to make a custom leaderboard for it to work

faint trench
#

not normal roblox one

summer zenith
#

So

#

You want us to debug

#

Something that isn't even roblox technically?

faint trench
#

heres what it looks like

#

i want to add "nil" to the table i guess

summer zenith
#

Your code is making 0 sense.

faint trench
#

wdym

summer zenith
#

you're adding nil to some table where you hold palyers

#

but you're checking some random parent for children??

#

ANd also HUGE no no

faint trench
summer zenith
#

You need local variables

faint trench
#

i did add a local variable

summer zenith
#

Your script has no sense of flow

faint trench
#

the variable show_nilAttribute

summer zenith
#

also if you're looping through the plr

#

Why not just for _, playerVariable in pairs(plr) do

faint trench
#

okay well

summer zenith
#

Also

faint trench
#

ima change

summer zenith
faint trench
summer zenith
#

strings dont have names 😭

faint trench
#

wait so i need to show the item with name nil

summer zenith
#

If your leaderboard is only going to display names, just insert the names themselves into the plr table

#

Otherwise add a type check if it's a string value or a player class

#

Or you can even add simulated players

#

Where you make a model or folder with all the stuff a normal player has

faint trench
#

is this better?

#

lemme test

summer zenith
#

You're checking if the item ISN'T nil

#

Therefore it will make everything have the text nil

#

i gtg eat

#

I'll be back in 30ish mins

summer zenith
#

I misread it

#

Everythings aight

faint trench
#

k

#

bro when i triggered the event where nil joins, the attribute didnt change at all

#
local nilJoined = {}

local Players = game:GetService("Players")
local PlayerGui = game:GetService("PlayerGui")
function nilJoined.Trigger()
    for _, player in Players:GetPlayers() do
        local show_nilAttribute = player.PlayerGui.StartGui.tray.Script:GetAttribute("show_nil")
        player.PlayerGui.nilJoined.Enabled = true
        player.PlayerGui.nilMessages.Enabled = true
        show_nilAttribute = true
    end
end

return nilJoined
#

its literally supposed to enable the attribute

faint trench
#

hang on what if i add BoolValue object to the script then use that to manage if nil shows up in player list or not

#

okay well the BoolValue called "show_nil" showed that its Enabled in playergui but nil didnt show up on player list

#

afk

summer zenith
#

You need to use :SetAttribute

#

:GetAttribute returns the value of the attribute

#

Not the attribute itself

faint trench
#

ill come up with new way to show nil on player list, i have changed the attribute to BoolValue object

#

but i have to like afk rn

faint trench
#

@summer zenith bro, nil still doesnt show up. like wth, i only set Visible to true and change text to "nil" but for some reason it doesnt show up

if show_nilAttribute.Value == true then
    if script.Parent.PlayerLabel1.Visible == true then
        if script.Parent.PlayerLabel2.Visible == true then
            if script.Parent.PlayerLabel3.Visible == true then

            else
                update()
                script.Parent.PlayerLabel3.Visible = true
                script.Parent.PlayerLabel3.Text = "nil"
            end
        else
            update()
            script.Parent.PlayerLabel2.Visible = true
            script.Parent.PlayerLabel2.Text = "nil"
        end
    else
        update()
        script.Parent.PlayerLabel1.Visible = true
        script.Parent.PlayerLabel1.Text = "nil"
    end
end

update()
game.Players.ChildAdded:connect(function (guy) table.insert(plr, guy) update() end)
game.Players.ChildRemoved:connect(function (guy) table.remove(plr, getNumber(guy)) update() end)
faint trench
#

FINALLY I MADE HIM APPEAR