Im trying to make the player invisible when it spawn’s with CharacterAppareanceLoaded, but it doesn’t seem to work.
There’s the script
local function characterTransparency(Character)
for _, v in pairs(Character:GetDescendants()) do
if v:IsA(“Part”) or v:IsA(“Decal”) then
v.Transparency = 1
if v.Name == "Head"then
v.face.Transparency = 1
elseif v.Name == “HumanoidRootPart” then
v.Transparency = 1
end
elseif v:IsA(“Accessory”) then
v.Handle.Transparency = 1
end
end
end
It’s an script and the parent is ServerScriptService
However, when using CharacterAdded makes it work but, i want it to work when it’s fully loaded, because if i dont it will cause accessory errors (Accessories not being invisible sometimes)
Alright, i identified that it’s the StarterCharacter what’s causing it, but how could i make the player invisible when he has a startercharacter? (And visible too)
It’s possible that CharacterAppearanceLoaded doesn’t check StarterCharacter’s.
Can you try this script in serverscriptservice and check if you still have the same issue?
for i,player in pairs(game.Players:GetPlayers()) do
local Character = player.Character or player.CharacterAdded:Wait()
for i,v in pairs(Character:GetDescendants()) do
if v:IsA("BasePart") or v:IsA("Decal") or v:IsA("Accessory") then
v.Transparency = 1 -- make it invisible
end
end
end
end
It works but i actually do not know about the accessories, about on the above i said, However, when using CharacterAdded makes it work but, i want it to work when it’s fully loaded, because if i dont it will cause accessory errors (Accessories not being invisible sometimes)
I do not really know if this will happen, because the last time i made something like this sometimes the accessory wasn’t invisible because i was using CharacterAdded.
local Players = game:GetService("Players")
local function playerAdded(player)
player.CharacterAppearanceLoaded:Connect(function(character)
local humanoid = character:WaitForChild("Humanoid")
for i, accessory in pairs(humanoid:GetAccessories()) do
i.Transparency = 1
end
for _, player in pairs(Players:GetPlayers()) do
playerAdded(player)
end
Players.PlayerAdded:Connect(playerAdded)
What im thinking about now is that i think CharacterAppearanceLoaded just straight ignores StarterCharacter, but when i put CharacterAdded works so ill try doing repeat until.
This works so i guess ill leave it here, thank’s for everything tho.
The 'CharacterAppearanceLoaded` event/signal only fires if the player’s on-site appearance loads, it is not compatible with custom starter characters.
local Game = game
local Players = Game:GetService("Players")
local function OnPlayerAdded(Player)
local function OnCharacterAdded(Character)
task.wait() --Wait for engine operations.
for _, Descendant in ipairs(Character:GetDescendants()) do
if (Descendant:IsA("BasePart") or Descendant:IsA("SurfaceAppearance")) then Descendant.Transparency = 1 end
end
end
Player.CharacterAdded:Connect(OnCharacterAdded)
end
Players.PlayerAdded:Connect(OnPlayerAdded)
I had some troubles with CharacterAppearanceLoaded not always working. Putting a task.wait() immediately after that event fires seems to have fixed it for me.