Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

No hair/face/accessories on spawn script?

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

2 comments

0

woops forgot to post my script 1 sec

0

what is script.Parent.Parent

2 answers

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)
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

This discussion is preserved as it was. New answers, comments, and votes are closed.