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