Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

No hair/face/accessories on spawn script?

Asked by 6 years ago
Edited 6 years ago

Title says all i could not find a way to make a script to remove/make them invisible please help :D

i found this script

local playerIndex = script.Parent.Parent.Name;
local player = workspace:WaitForChild(playerIndex);

for _, accessory in pairs(player:GetChildren()) do
    if (accessory.ClassName == "Accessory") then
        accessory.Handle.Transparency = 1;
    end
end

didnt do anything tho

0
woops forgot to post my script 1 sec amuseren 1 — 6y
0
what is script.Parent.Parent User#19524 175 — 6y

2 answers

Log in to vote
0
Answered by
hellmatic 1523 Moderation Voter
6 years ago

You can use the PlayerAdded and CharacterAdded event:

Server script:

game.Players.PlayerAdded:Connect(function(player)
    player.CharacterAdded:Connect(function(character)
        for i, v in pairs(character:GetChildren()) do 
            if v:IsA("Accessory") then 
                v:Destroy()
                --v.Handle.Transparency = 1
            end
        end
    end)
end)
Ad
Log in to vote
0
Answered by 6 years ago
local playerIndex = script.Parent.Name;
local player = workspace:WaitForChild(playerIndex);

for _, accessory in pairs(player:GetChildren()) do
    if (accessory.ClassName == "Accessory") then
        accessory:Destroy()
    end
end

LocalScript in the StarterCharacterScripts

Answer this question