#Hide Players Script
1 messages · Page 1 of 1 (latest)
i tried to add a function with CharacterAdded, to try and check everytime the player respawns but it just doesnt work
and im not sure if i wanna use like a true do loop instead or runService
could someone help ?
gtg eat ill come back
can you pass your script so we can check what its the problem?
do a for loop through the players then continue if the player is the local player then loop through their character and set all meshes or accsessories transparency to 1
yea ok but now i gotta add smtg so it keeps doing this even after the player respawns
deleted everything
rage quit
sory
🥀
imma try to remake the script
game.Players.PlayerAdded???
what you really want to track is when a player is added, and then to that player that was added track the character added, also before this loop through all the actual players characters
this thing :
local name = {}
:
first of all loop trhough all the characters of all the actual players, from that just detect when a player is added and detect his character added
ok im not sure i understand can i send my actual code ??
ok
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 hidePlrButton = SF.HidePlayers.Button
local player = game.Players.LocalPlayer
local character = player.Character
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 on then
Skies.Visible = true
on = true
else
Skies.Visible = false
on = false
end
end)
hidePlrButton.Activated:Connect(function()
if not on then
on = true
-- hide the players
for _, player in pairs(game.Players:GetPlayers()) do
if player.Character then
for _, parts in pairs(player.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
else
on = false
-- show the players
for _, player in pairs(game.Players:GetPlayers()) do
if player.Character then
for _, parts in pairs(player.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)
i have multiple things in the script tho
first of all you're using the variable on for both hideplayer button and skychanger
and thats what I say, what you're doing here is only loop through the ACTUAL players character, and when someone dies or someone joins you does not detect it, so before it you would need to keep track of what it's happening with .PlayerAdded and from there in the loop connect to all the ACTUAL players the characteradded
ngl I don't know how to explain it well
I mean I can do an example script if you want
just make a count player function
and then do a main loop that calls it every so often
yh
but i dont wanna use that
its not optimal and i dont like it
okay then just make a countplayer function and call it within your other function
just make a table
yea
thats what i proposed first but then the other guy said not to do that
idk why?
me neither
💀
ill wait for him to show me the script
he said hes gonn show me an exemple script
local PlayerTable:{Player}={}
local Players = game:GetService("Players")
local function CountPlayers()
table.clear(PlayerTable)
local PlayersInGame = Players:GetPlayers()
table.insert(PlayerTable,PlayersInGame)
print(PlayerTable)
end
CountPlayers()
something like that
I'm doing the example code and not to call you noob or smth but I don't know if you gonna understand all
did he use ai to script
because last time I did this exactly functionality I was bad and well now that I'm doing it again I see the fails and doing more complex things
how tf
local test = test
idk how u made it ed
no i did not
but i need to make that i module script no ??
cause if its in a local script its only going to save players that join after you joined