Introduction
On this post I will be showing you how to Remove a Players Packages and Revert them back to the Default “Blocky” look! Its actually a very Easy and Simple script and is Easy to Replicate! Without Further to do, Lets get to work!
Step 1: Create a LocalScript in StarterCharacterScripts
Feel free to name this script whatever, The full script will be shown at the end!
Step 2: Write the Variables
Lets start by writing a few Variables. First we want to get the Players Character:
--Variables
local playerCharacter = script.Parent -- Gets the Character
Then we need to get to get the Children of the PlayerCharacter, we can do this by using the :GetChildren
Attribute as shown:
local getParts = playerCharacter:GetChildren() -- Gets the children of the PlayerCharacter
Once your finished with the Variables it should look like this:
--Variables
local playerCharacter = script.Parent -- Gets the Character
local getParts = playerCharacter:GetChildren() -- Gets the children of the PlayerCharacter
Step 3: Write the Function
Now that we have the Variables we can now move on to the Actual function. Lets start by getting the Children by writing the following:
-- Function
for _, v in pairs(getParts) do -- Change "getParts" to whatever your ":GetChildren" Variable is called.
end
Then we have to make sure we only Remove the necessary Objects from the player by detecting any Children that are a “CharacterMesh”. We can do this by writing the Following:
for _, v in pairs(getParts) do
if v:IsA("CharacterMesh") then
end
end
Now that we can Detect whether a Child of the PlayerCharacter is a CharacterMesh we can delete them by writing the following:
for _, v in pairs(getParts) do
if v:IsA("CharacterMesh") then
v:Destroy()
end
end
-- Detects if a Child is a CharacterMesh and if they are then they are Destroyed
Conclusion
And as easy as that, We are done! Here is the Full Script:
-- Variables
local playerCharacter = script.Parent -- Gets the Character
local getParts = playerCharacter:GetChildren() -- Gets the children of the PlayerCharacter
-- Function
for _, v in pairs(getParts) do
if v:IsA("CharacterMesh") then
v:Destroy()
end
end
-- Detects if a Child is a CharacterMesh and if they are then they are Destroyed
Let me know what other Tutorials you could use and what else I should do!
Sincerly, UnmaskedCode