#Hide Players doesnt work

1 messages · Page 1 of 1 (latest)

marble girder
#

im trynna make a Hide Players button, when clicked it hides all current players in the game. Ive tried everything but i give up it still doesnt work

#

my module script :

#
local allPlayers = {}

for _, plr in pairs(game.Players:GetPlayers()) do
    allPlayers[plr.UserId] = plr
end

game.Players.PlayerAdded:Connect(function(plr)
    allPlayers[plr.UserId] = plr
end)

game.Players.PlayerRemoving:Connect(function(plr)
    allPlayers[plr.UserId] = nil
end)

return allPlayers
#

it puts all players in the server in a table

#

if it works

#

and the main script :

#
hidePlrButton.Activated:Connect(function()
    if not on then
        on = true
        -- hide the players
        
        for userId, plr in pairs(allPlayers) do
            if plr ~= localPlayer then
                if plr.Character then
                    for _, parts in pairs(plr.Character:GetDescendants()) do
                        if parts:IsA("BasePart") or parts:IsA("Decal") then
                            parts.LocalTransparencyModifier = 1
                        elseif parts.Name == "Nametag" then
                            parts.Enabled = false
                        end
                    end
                end
            end
        end
        
    else
        on = false
        -- show the players
        for userId, plr in pairs(allPlayers) do
            if plr ~= localPlayer then
                if plr.Character then
                    for _, parts in pairs(plr.Character:GetDescendants()) do
                        if parts:IsA("BasePart") or parts:IsA("Decal") then
                            parts.LocalTransparencyModifier = 0
                        elseif parts.Name == "Nametag" then
                            parts.Enabled = true
                        end
                    end
                end
            end
        end
    end
end)
#

didnt copy paste everything cause its too long

#
allParts
#

that is the module script btw

#

pls someone help

#

i do not understand why it doesnt work

#

gotta take a shit im coming back

scenic sluice
#

Why did you do localtransparrencymodifier instead of just transparency?

marble girder
#

idk roblox studio proposed this to me

#

i just clicked tab

#

it works

#

so dont touch it

scenic sluice
marble girder
#

no wait

#

forgot to say smtg

scenic sluice
#

Wait so the button does not work?

marble girder
#

the script works fine

#

BUT

#

when the players dies and respawn

#

i can see them

raven moon
#

so this was just made with ai or am i misunderstanding

marble girder
#

made by me

scenic sluice
#

Ah i see thats because the char gets reset

marble girder
#

how

#

where

#

when

scenic sluice
#

Just do game.players.Characteradded:connect()

#

And them make it transparent

marble girder
#

where

#

where i add the character added

scenic sluice
#

The part where you make the current character transparent

#

After the loop

marble girder
#

after the for loop

#

on top

#

??

#

oh wait i think i got it

scenic sluice
#

Does it work?

marble girder
#

wait im almost done

#

ok

#

trying it

#

rn

#

suspens

scenic sluice
#

🙀

marble girder
#

doesnt work at all

scenic sluice
#

Bruh

#

Show me the new code

#

In ss form

#

Cuz im mobile

marble girder
#
hidePlrButton.Activated:Connect(function()
    if not on then
        on = true
        -- hide the players
        
        for userId, plr in pairs(allPlayers) do
            if plr ~= localPlayer then
                plr.CharacterAdded:Connect(function(char)
                    for _, parts in pairs(char:GetDescendants()) do
                        if parts:IsA("BasePart") or parts:IsA("Decal") then
                            parts.Transparency = 1
                        elseif parts.Name == "Nametag" then
                            parts.Enabled = false
                        end
                    end
                end)
            end
        end
        
    else
        on = false
        -- show the players
        for userId, plr in pairs(allPlayers) do
            if plr ~= localPlayer then
                plr.CharacterAdded:Connect(function(char)
                    for _, parts in pairs(plr.Character:GetDescendants()) do
                        if parts:IsA("BasePart") or parts:IsA("Decal") then
                            parts.LocalTransparencyModifier = 0
                        elseif parts.Name == "Nametag" then
                            parts.Enabled = true
                        end
                    end
                end)
            end
        end
    end
end)
#

i tried to implement character added

#

i think im missing smtg

scenic sluice
#

LOL

#

You gotta set transparency to 1 instead of 0

#

I make that mistake a lot too

marble girder
#

no way

#

nah

#

transparency

#

is right

#

it 1

scenic sluice
#

Does it work?

marble girder
#

no

#

: (

scenic sluice
#

Try to change that from localtransparrencymodifier to transparency too

marble girder
#

yea changeed it

#

do i ask gpt ??

scenic sluice
#

Oh i see

marble girder
#

tell me what you see

scenic sluice
#

You did the for loop

#

On plr character

#

Even though you need to do it in char

#

In function(char)

#

Use that char instead

marble girder
#

the ```lua
for userId, plr in pairs(allPlayers) do

inner creekBOT
#

studio** You are now Level 8! **studio

marble girder
#

????

scenic sluice
#

No

#

For_, parts in plr.charater:GetDecendences() do

marble girder
#

ohhhhhhhhhhhh

inner creekBOT
#

Here you go! WIZARD6

scenic sluice
#

And?

marble girder
#

yea but

#

thats on the second thing

#

the one that show players

#

but now they dont want to hide anymore

#

lemme show you

scenic sluice
#

What

#

Mabey make a short vid?

marble girder
#

dw the gui doesnt work properly

#

its normal

scenic sluice
#

Ah so the button broke

marble girder
#

no

#

the button works

scenic sluice
#

The plr not dissappear?

marble girder
#

yea but before adding the cahracteradded event it was hiding them

#

so

scenic sluice
#

1 min

marble girder
#

its not the button

#

imma just ask gpt

scenic sluice
#

Hey so umm

#

HOLD ON

#

@marble girder

#

WE CAN DO THIS

#

@marble girder NOOO

#

@marble girder

#

@marble girder

#

@marble girder

marble girder
#

im holding on

#

but

#

i already saw what he said

#

and lemme tell you

#

i could not have figured that out

scenic sluice
#

Send a ss of the full script cuz i think you have 2 events that detect if a new character is born but 0 events that make the current one invisible

#

Don't tell me tho

#

I wanna figure it out :>

marble girder
#

full script

scenic sluice
#

Just the code

marble girder
#

oh nvm it didnt send

scenic sluice
#

That you just send

#

Lol

marble girder
#

its gonna be in 2 times

scenic sluice
#

I see 0 times

marble girder
#
local ScreenGui = script.Parent
local MenuButton = ScreenGui:WaitForChild("OpenMenu")
local settingsMenu = ScreenGui:WaitForChild("Menu")
local closeSettings = settingsMenu.MenuCloser
local SF = settingsMenu.ScrollingFrame
local SkyChanger = SF.Skychanger.TextButton
local Skies = SF.Skychanger.Skies
local on = false
local on1 = false
local hidePlrButton = SF.HidePlayers.Button
local localPlayer = game.Players.LocalPlayer
local localCharacter = localPlayer.Character
local allPlayers = require(game.ReplicatedStorage.AllPlayersInServer)

MenuButton.Activated:Connect(function()
    MenuButton.Visible = false
    settingsMenu.Visible = true
end)

closeSettings.Activated:Connect(function()
    MenuButton.Visible = true
    settingsMenu.Visible = false
end)

SkyChanger.Activated:Connect(function()
    if not on1 then
        Skies.Visible = true
        on1 = true
    else
        Skies.Visible = false
        on1 = false
    end
end)
scenic sluice
#

;-;

marble girder
#
hidePlrButton.Activated:Connect(function()
    if not on then
        on = true
        -- hide the players
        
        for userId, plr in pairs(allPlayers) do
            if plr ~= localPlayer then
                plr.CharacterAdded:Connect(function(char)
                    for _, parts in pairs(char:GetDescendants()) do
                        if parts:IsA("BasePart") or parts:IsA("Decal") then
                            parts.Transparency = 1
                        elseif parts.Name == "Nametag" then
                            parts.Enabled = false
                        end
                    end
                end)
            end
        end
        
    else
        on = false
        -- show the players
        for userId, plr in pairs(allPlayers) do
            if plr ~= localPlayer then
                plr.CharacterAdded:Connect(function(char)
                    for _, parts in pairs(char:GetDescendants()) do
                        if parts:IsA("BasePart") or parts:IsA("Decal") then
                            parts.Transparency = 0
                        elseif parts.Name == "Nametag" then
                            parts.Enabled = true
                        end
                    end
                end)
            end
        end
    end
end)```
#

full script

scenic sluice
#

Hey so you have characteradded 2 times

#

But if they haven't died then there will be no nee character added

marble girder
#

yea now that u say it

#

makes sense

scenic sluice
#

Copy the last characyeradded and control z till old script

#

Then paste it under

marble girder
#

too late

#

i already launched the game

scenic sluice
#

Gpt?

marble girder
#

mulltiple times

#

i cant go back

scenic sluice
#

Wdym

#

You pasted it in this chat

marble girder
#

once u start the game

#

oh

marble girder
scenic sluice
#

👌

scenic sluice
#

Think so

#

But can you send a screenshot instead its hard to read on mobile

#

Of the code

marble girder
#

and i gotta make that respawn bubble disapear too

#

later

scenic sluice
#

Idk why you made 2 for loops but

#

Replace the bottem one with the characteradded code

#

Oh wsit

#

Wait

marble girder
#

all the bottom thing ?

scenic sluice
#

Now i get it

raven moon
#

you dont need the 2 loops but it works

scenic sluice
#

At the end of the first for loop

scenic sluice
marble girder
#

what do yall mean

scenic sluice
#

Just paste it below the First for loop

#

Above the else tho

marble girder
#

ok

scenic sluice
#

Mb it was a bit hard to read so i missed a little stuff

marble girder
#

wait

scenic sluice
#

Below first loop above else statement

marble girder
#

ok but what i paste ?

#

the rest of the code

scenic sluice
#

The characteradded thing we made before

marble girder
#

all the script or only the char added event ?

scenic sluice
#

Just the function

marble girder
#

ok

raven moon
#

wait did he not add cgaracter added

#

character

#

i thought he did

scenic sluice
#

He did now

raven moon
#

oh

scenic sluice
#

Bon a peti @marble girder

raven moon
#

bros been cooking to help noname

scenic sluice
#

Xd

marble girder
#

like that ?

scenic sluice
#

NONO

marble girder
#

lol

scenic sluice
#

Below the for loop

#

So after the last end

#

And above the else statement

marble girder
#

the second for statement ?

#

i mean

#

it is below the for loop

raven moon
#

🙏🙏

scenic sluice
#

There

marble girder
#

im sorry english is not my first language

scenic sluice
#

Thats a lot easier

#

Dw about it

fast pond
scenic sluice
#

Its nice for very specific situations

raven moon
#

cus he might’ve used ai

#

🤷‍♂️

fast pond
scenic sluice
#

Nah that was before ai

raven moon
marble girder
#

cant put it here

#

plr doesnt exist yet

raven moon
#

in the 8 months ive been scripting i dont think ive ever used pairs tbf

marble girder
scenic sluice
#

Game.players

scenic sluice
marble girder
#

oh

#

so instead of plr i should get all the players ??

scenic sluice
#

Does game.players.characteradded() work?

marble girder
#

plr.characteradded:connect(fun())

#

plr

#

not exist

scenic sluice
#

Oh hold on

#

I messed up

marble girder
#

thats crazy

scenic sluice
#

Move it up one end

marble girder
#

ok

fast pond
# marble girder

Put “local allPlayers = game:GetService(“Players”)” inside the function

marble girder
fast pond
#

Im sleepy

scenic sluice
raven moon
#

eepy ah

scenic sluice
#

Mb it's pretty late so im not on point

marble girder
marble girder
scenic sluice
#

No thid is a different position

#

Then the other one

raven moon
scenic sluice
#

Its above one end

marble girder
#

one end higher ?

scenic sluice
scenic sluice
raven moon
#

man im enjoying the show

scenic sluice
#

Lol

raven moon
#

someone who can script this but doesnt know character added

marble girder
raven moon
#

or functions it seems

marble girder
#

i know functions

scenic sluice
#

YES

raven moon
#

hey

#

your trying

marble girder
#

character added is new

#

tho

scenic sluice
#

THINK THATS IR

raven moon
#

and suceeding

scenic sluice
#

Alr now add the code you madr

marble girder
#

what code

#

the whole code ?

scenic sluice
#

The code inside the function

marble girder
#

so just put the function inside ?

scenic sluice
#

The same for loop above that (for i, parts in character do)

marble girder
#

ok got it

#

now i gotta change the player.character into char

#

right ?

scenic sluice
marble girder
#

yea

scenic sluice
#

Put that inside the function but

#

Replace the for loop with: for_, parts in char:GetDec() do

marble girder
#

dont i need

#

to change

#

the plr.Character

#

by cahr

scenic sluice
#

Yes

marble girder
#

too ??

#

ok

scenic sluice
#

Alr send a ss

marble girder
raven moon
#

💔🙏

scenic sluice
#

Yep

#

Thats it

#

Try it out

marble girder
#

ok lemme try

raven moon
#

fire

marble girder
#

go in general

#

1

#

imma stream it

#

historical moment

raven moon
#

this was all my work

#

oh lmao

scenic sluice
#

Well uhh

#

It kinda worked

marble girder
#

heisenberg still there

#

i mean he's the danger

raven moon
#

just destroy the accessories

#

ngl

wooden thicket
#

what the hell is this code

#

bruh

marble girder
#

lol

wooden thicket
#

theres a much easier way via local script to do that

marble girder
#

lol

raven moon
#

whats your point

scenic sluice
#

Add a lil code that detects if its a accessory and sets transparrency or enabled to false

wooden thicket
marble girder
#

the thing is

#

now it works

marble girder
#

i just gotta make the other accesories dispear

wooden thicket
#

yall could have helped

marble girder
#

so thx for your hhelp

wooden thicket
scenic sluice
raven moon
marble girder
#

why being toxic randomly ??

#

ive been scripting for lees than a month bro

scenic sluice
#

Its not about how hard or easy it is for you and me, its about how he has to be able to understand it and apply it

wooden thicket
scenic sluice
#

Im not chatgpt

raven moon
#

i have been watching this unfold

#

😆

wooden thicket
#

if he wants to learn, he would ask. He doesnt? He wont. His problem.

scenic sluice
#

Go back to your own chat

marble girder
#

scared me

wooden thicket
#

not gonan ber ude abt it

#

but thats how it is

scenic sluice
wooden thicket
raven moon
#

🤦‍♂️

wooden thicket
scenic sluice
#

My point is that im trying to help him get better

raven moon
#

help with scripts not full scripts

wooden thicket
#

how is providing scripts not helping?

marble girder
#

im trynna make the hair and the "pro" chain disapear but they sould disapear cause i already make parts disapear

scenic sluice
#

And copy paste it into this chat

raven moon
#

they dont learn. teach people to solve it themselves and guide them not giving them a full script

wooden thicket
#

bouta ask chatgpt for ur dads existence and copy paste it

marble girder
scenic sluice
marble girder
#

the hair and the accesories are parts right ??

raven moon
#

maybe

#

i actually dont know

wooden thicket
scenic sluice
# marble girder

Alr so the reason why it bugged is because we didint take into account for accessories

scenic sluice
marble girder
#

is accessories a class type ??

scenic sluice
marble girder
#

like can i just add an "or"

#

i can see them

#

but

wooden thicket
#

i cant watch this anymore, @marble girder can I rewrite this in dms for you? If you have questions about the code, just ask

marble girder
#

they dont have

#

transparency

marble girder
#

well see if its better than mine

scenic sluice
#

If you just want the script @marble girder then ask gpt

wooden thicket
raven moon
#

what is the point if he doesnt understand it 💔💔

wooden thicket
raven moon
marble girder
#

all them messages to give up at the end

raven moon
#

yeah nice one

scenic sluice
marble girder
#

dw i got it from here

raven moon
wooden thicket
scenic sluice
#

Piece of shat to me = piece of shat to you

marble girder
#

i think

wooden thicket
#

like bro

inner creekBOT
#

studio** You are now Level 9! **studio

marble girder
#

@wooden thicket

scenic sluice
#

Less goo

marble girder
#

u said u could make the code better

#

make

#

it

#

then

wooden thicket
#

yes check dms

inner creekBOT
#

studio** You are now Level 4! **studio

scenic sluice
scenic sluice
#

No difference

raven moon
#

fo sure

scenic sluice
#

I didint think people would be toxic in this type stufd 🥀

#

Hes falling to the dark side..

#

@marble girder come back!

marble girder
#

he says he can do the code

#

better

#

and simpler

#

i thank you 1000 times for your help

scenic sluice
#

Yh but what if you have the same problem later

#

💔

marble girder
#

dw

#

ill try with both scripts

scenic sluice
#

@raven moon we gotta ban this guy

scenic sluice
raven moon
#

man i don’t care allat much 🙏💔

marble girder
#

nah

#

cant be

#

already asked chat gpt 10 times he gave me shit scripts

scenic sluice
#

I was making a point <\3

scenic sluice
marble girder
#

so i gave up and made one myself

marble girder
scenic sluice
#

LOL

#

Alr well gl

wooden thicket
#

@marble girder whyd u block me?

#

tf did i do?

#

heres the script ig?

#

bruh

#

in there is the script.

marble girder
#

@scenic sluice

#

im trynna add accesories to ur code

#

but im too tired

#

ill try to finish that code tomorrow

#

its 2 am already

#

thx for everything

#

again

#

btw i didnt block him

wooden thicket
#

ye mb about that some error was there

#

thought he blocked me

marble girder
#

yall should all apppologies

#

and become friends

#

instead of being mean to eachother

#

even if he started or if someone else started

#

dont care

#

make love not war

marble girder
#

"faites l'amour pas la guerre" ( in french )

#

its more like : have segs dont make war

#

but yea

#

u got it

wooden thicket
#

I dont even add

#

but what I can do is forgive

marble girder
#

@scenic sluice

#

i fixed it

#

your script was right

#

u just neede to add a cooldown

#

cause the meshes and accesories where spawning before the character

#

so yea

#

i added a task.delay(1, function()

end)

#

before the for loop

#
hidePlrButton.Activated:Connect(function()
    if not on then
        on = true
        -- hide the players

        for userId, plr in pairs(allPlayers) do
            if plr ~= localPlayer then
                if plr.Character then
                    task.delay(1, function()
                        for _, parts in pairs(plr.Character:GetDescendants()) do
                            if parts:IsA("BasePart") or parts:IsA("Decal") then
                                parts.LocalTransparencyModifier = 1
                            elseif parts.Name == "Nametag" then
                                parts.Enabled = false
                            end
                        end
                    end)
                end
                plr.CharacterAdded:Connect(function(char)
                    if char then
                        task.delay(1, function()
                            for _, parts in pairs(char:GetDescendants()) do
                                if parts:IsA("BasePart") or parts:IsA("Decal") then
                                    parts.LocalTransparencyModifier = 1
                                elseif parts.Name == "Nametag" then
                                    parts.Enabled = false
                                end
                            end
                        end)
                    end
                end)
            end
        end
        
    else
#
        on = false
        -- show the players
        for userId, plr in pairs(allPlayers) do
            if plr ~= localPlayer then
                if plr.Character then
                    task.delay(1, function()
                        for _, parts in pairs(plr.Character:GetDescendants()) do
                            if parts:IsA("BasePart") or parts:IsA("Decal") then
                                parts.LocalTransparencyModifier = 0
                            elseif parts.Name == "Nametag" then
                                parts.Enabled = true
                            end
                        end
                    end)
                end
            end
        end
    end
end)
#

all the script

#

for those who want

#

thx again @scenic sluice

#

ill syd

scenic sluice
#

Np man

marble girder
#

btw

#

the other guys script

#

wasnt owrking

#

if you wanna know

scenic sluice
#

Nah I dont rlly care i just hoped you leared something

marble girder
#

learn alot

#

next time ill want to make this i will remember you and make it right

#

progress 💪