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

How do I remove a t-shirt from a character?

I want to change the ShirtGraphic from a character, but it seems like disabling RobloxLocked is impossible without using the console, so I'm thinking of destroying a t-shirt from a player completely, deleting the ShirtGraphic and the roblox decal, and making my own t-shirt via script. However, this seems to be impossible, since I cannot seem to remove the t-shirt, and I can't make a decal overlap it. This is my script:

game.Players.PlayerAdded:connect(function(plr)
	plr.CharacterAdded:connect(function(chr)
		chr["Shirt Graphic"]:Destroy()
		chr.Torso.roblox:Destroy()
		local shirt = Instance.new("Decal", chr.Torso)
		shirt.Face = "Front"
		shirt.Texture = "rbxassetid://167837386"
	end)
end)

It doesn't work, obviously. Please help me.

1 comment

0
  1. My first comment was wrong- lemme fix it. 2) chr:FindFirstChildOfClass("ShirtGraphic"):Destroy() --I accidentally did :WaitForChildOfClass("ShirtGraphic") lol.

2 answers

-- Run this in a local script

local player = game.Players.LocalPlayer
local char = player.Character

for i,v in pairs(player.Character:children()) do
	if v.ClassName = "ShirtGraphic" then
		v:Destroy()
	end
end

local shirt = Instance.new("Decal", char.Torso)
shirt.Face = "Front"
shirt.Texture = "rbxassetid://167837386"


2 comments

0

Nope. This doesn't work. By the way, you have a syntax error. The "=" in line 7 should be "==".

0

Oops.

for _, child in pairs(playerInWorkspace:GetChildren()) do
    if child:IsA('Hat') then
		print("removed hat")
        child:Destroy()
   	 end
	if child:IsA('ShirtGraphic')then
		print("removed shirt graphic")
		child:Destroy()
	end
	if child:IsA('Shirt')then
		print("removed shirt")
		child:Destroy()
	end
	if child.Name == "Torso" then
		for _, TorsoChild in pairs(child:GetChildren()) do
			if TorsoChild:IsA('Decal')then
				print("Decal Removed")
				TorsoChild:Destroy()
			end
		end
	end
end 

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