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

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

Asked by 7 years ago

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.

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

2 answers

Log in to vote
0
Answered by 7 years ago
-- 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"


0
Nope. This doesn't work. By the way, you have a syntax error. The "=" in line 7 should be "==". Rodmane234 85 — 7y
0
Oops. User#12753 0 — 7y
Ad
Log in to vote
0
Answered by 7 years ago
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 

Answer this question