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

Clothes Removed On Entry?

Asked by 10 years ago

I know this is possible, but I can not seem to script it. I am trying to make a script which removes a players clothes and hats on entry. I know it involves the on entry built in function but other then that all attempts have failed. Any help, or even a working script would be much appreciated!

-- Skunk940

Here's the script so far. It removes the shirt but nothing else.

Game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function(character)
repeat wait() until character:findFirstChild("Pants")
print("Ready")
wait(1)
shirt = character:findFirstChild("Shirt")
if shirt ~= nil then
shirt:Destroy()
end
priint("Shirt removed")
pants = character:findFirstChild("Pants")
if pants ~= nil then
pants:Destroy()
end
print("Pants removed")
roblox = character.Torso:findFirstChild("roblox")
if roblox ~= nil then
roblox:Destroy()
end
tshirt = character:findFirstChild("Shirt Graphic")
if tshirt ~= nil then
tshirt:Destroy()
end
print("T-Shirt destroyed")
end)
end)
1
Give the script your best try first. After that, you can come here and show us your script so we can help you fix it. But there are no requests like this on this forum. NoahWillCode 370 — 10y

2 answers

Log in to vote
2
Answered by
Perci1 4988 Trusted Moderation Voter Community Moderator
10 years ago

It's actually much simpler than what you're trying to do. There's a property called CanLoadCharacterAppearance() that, when set to false, will cause the character to not load normally, which would include shirts and pants.

game.Players.PlayerAdded:connect(function(plr)
    plr.CanLoadCharacterAppearance = false
end)
0
Nice, thanks skunk940 10 — 10y
Ad
Log in to vote
0
Answered by 10 years ago

In StarterPack

Player=script.Parent.Parent
Character=Player.Character
wait(1)
for i,v in pairs(Character:GetChildren()) do
    if v:IsA("Hat") or v:IsA("Shirt") or v:IsA("Pants") or v:IsA("Shirt Graphic") or v:IsA("CharacterMesh") then
        v:remove()
    end
end

Answer this question