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

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

Asked by 4 years ago
01local Pants = script.Pants
02local Shirt = script.Shirt
03 
04script.Parent.ClickDetector.MouseClick:connect(function(Player)
05    local Character = Player.Character
06    if Character == nil then return end
07 
08    -- Get new shirt
09    local CharacterShirt = Character:findFirstChild("Shirt")
10    if CharacterShirt then CharacterShirt:Destroy() end
11    Shirt:Clone().Parent = Character
12 
13    -- Get new pants
14    local CharacterPants = Character:findFirstChild("Pants")
15    if CharacterPants then CharacterPants:Destroy() end
16    Pants:Clone().Parent = Character
17end)

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

2 answers

Log in to vote
1
Answered by 4 years ago

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.

01local Player = game:GetService("Players").LocalPlayer
02local PartToWeld = Instance.new("Part")
03PartToWeld.Parent = workspace
04PartToWeld.Anchored = false
05PartToWeld.CanCollide = true
06PartToWeld.Size = Vector3.new(1,2,1)
07local Weld = Instance.new("Weld")
08Weld.Part0 = Player.Character:FindFirstChild("Torso") or Player.Character:FindFirstChild("UpperTorso")
09Weld.Part1 = PartToWeld
10Weld.C0 = CFrame.new(0,0,1)
11Weld.Parent = Weld.Part0
12 
13repeat
14    wait()
15until Player.Character ~= nil
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 Asherharding10 12 — 4y
0
could you mark the answer as correct please TheLuminent 1204 — 4y
Ad
Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

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

0
This is pretty vague, if you could explain more that would be nice. Asherharding10 12 — 4y

Answer this question