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

I made a script and it's not working right, can someone help?

Asked by 4 years ago

I made this script:

local removedac = false
local weared = false
local hat = script.Parent.Parent["Space Hat"]
local pants = script.Parent.Parent.Pants
local shirt = script.Parent.Parent.Shirt

script.Parent.Touched:Connect(function(hit)
    if hit.Parent:FindFirstChild("Humanoid") then
        if removedac == false then
            hit.Parent.Humanoid:RemoveAccessories()
            hat:Clone().Parent = hit.Parent
            hit.Parent.Pants:Destroy()
            hit.Parent.Shirt:Destroy()
            pants:Clone().Parent = hit.Parent
            shirt:Clone().Parent = hit.Parent
            removedac = true
        end
    end
end)

The problem is there is a glass part inside space hat and its just falling after cloning. Whole space hat is fine and its not anchored. I tried to anchor glass part inside space hat but in this case its just not copying. Hope someone know how to make this part cloning and remaining in space hat.

1
weld User#6546 35 — 4y
0
? Sasha_Syshenko 20 — 4y
1
Accessories should be welded. LinavolicaDev 570 — 4y
0
Oh, now I understand, thanks for help! Sasha_Syshenko 20 — 4y

Answer this question