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

Instead of clothes how do I make it so you wear a object?

local Pants = script.Pants
local Shirt = script.Shirt

script.Parent.ClickDetector.MouseClick:connect(function(Player)
    local Character = Player.Character
    if Character == nil then return end

    -- Get new shirt
    local CharacterShirt = Character:findFirstChild("Shirt")
    if CharacterShirt then CharacterShirt:Destroy() end
    Shirt:Clone().Parent = Character

    -- Get new pants
    local CharacterPants = Character:findFirstChild("Pants")
    if CharacterPants then CharacterPants:Destroy() end
    Pants:Clone().Parent = Character
end)

I wan't to make it so you can wear a object instead of shirt's and pant's.

2 answers

here's my example this puts a little part on your characters back.

make sure to make this as a LocalScript in StarterCharacterScripts.

this is only an example! you can always make welds differently.

local Player = game:GetService("Players").LocalPlayer
local PartToWeld = Instance.new("Part")
PartToWeld.Parent = workspace
PartToWeld.Anchored = false
PartToWeld.CanCollide = true
PartToWeld.Size = Vector3.new(1,2,1)
local Weld = Instance.new("Weld")
Weld.Part0 = Player.Character:FindFirstChild("Torso") or Player.Character:FindFirstChild("UpperTorso")
Weld.Part1 = PartToWeld
Weld.C0 = CFrame.new(0,0,1)
Weld.Parent = Weld.Part0

repeat
	wait()
until Player.Character ~= nil

2 comments

0

Thanks, but anyway I can use this in my original script, because I have a click detector setup so when you click it, it give's you whatever. Thanks again

0

could you mark the answer as correct please

Weld the object to the body part For example lets say you want body armor you use Weld To connect the body armor to the body part for example the torso or upper torso

1 comment

0

This is pretty vague, if you could explain more that would be nice.

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