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

I need help with factorials and hats, any ideas?

Asked by 7 years ago
Edited 7 years ago

Please provide more explanation in your question. If you explain exactly what you are trying to accomplish, it will be much easier to answer your question correctly.

Trying to record the hat's of the player, remove them, then put them back on after the teleportation.

function touch(plar)
    local P1 = Instance.new("Part")
    local P2 = Instance.new("Part")
    local P3 = Instance.new("Part")
    local P4 = Instance.new("Part")
    local P5 = Instance.new("Part")
    local P6 = Instance.new("Part")
    local char = plar.parent
    local RA = char["Right Arm"]
    local LA = char["Left Arm"]
    local LL = char["Left Leg"]
    local RL = char["Right Leg"]
    local Shirt = char.Shirt:Clone()
    local Pants = char.Pants:Clone()
    local LAB = char["Left Arm"].BrickColor.Name
    local RAB = char["Right Arm"].BrickColor.Name
    local LLB = char["Left Leg"].BrickColor.Name
    local RLB = char["Right Leg"].BrickColor.Name
    local TB = char.Torso.BrickColor.Name
    local HB = char.Head.BrickColor.Name
    P1.BrickColor = BrickColor.new(LAB)
    P2.BrickColor = BrickColor.new(RAB)
    P3.BrickColor = BrickColor.new(LLB)
    P4.BrickColor = BrickColor.new(RLB)
    P5.BrickColor = BrickColor.new(TB)
    P6.BrickColor = BrickColor.new(HB)
    char.Torso.Anchored = true
    local Hum = char.Humanoid
    for i, amTrack in pairs(Hum:GetPlayingAnimationTracks()) do
        amTrack:Stop()
    end
    wait(1)
    char.Shirt:remove()
    char.Pants:remove()
    char.Torso.BrickColor = BrickColor.new("Deep orange")
    RA.BrickColor = BrickColor.new("Deep orange")
    LA.BrickColor = BrickColor.new("Deep orange")
    LL.BrickColor = BrickColor.new("Deep orange")
    RL.BrickColor = BrickColor.new("Deep orange")
    char.Head.BrickColor = BrickColor.new("Deep orange")
    wait(2)
    for s = 1,10 do
        char.Torso.Transparency = char.Torso.Transparency + .1
        char.Head.Transparency = char.Head.Transparency + .1
        RA.Transparency = RA.Transparency + .1 
        LA.Transparency = LA.Transparency + .1
        LL.Transparency = LL.Transparency + .1
        RL.Transparency = RL.Transparency + .1
        wait(.1)
    end
    char.Torso.CFrame = script.Parent.Parent.Tele2.CFrame * CFrame.new(0, 5, 0)
    wait(1)
    Shirt.Parent = char
    Pants.Parent = char
    char.Torso.Anchored = false
    char.Head.BrickColor = BrickColor.new(P6.BrickColor.Name)
    char.Torso.BrickColor = BrickColor.new(P5.BrickColor.Name)
    RA.BrickColor = BrickColor.new(P2.BrickColor.Name)
    LA.BrickColor = BrickColor.new(P1.BrickColor.Name)
    LL.BrickColor = BrickColor.new(P3.BrickColor.Name)
    RL.BrickColor = BrickColor.new(P4.BrickColor.Name)
    for i, amTrack in pairs(Hum:GetPlayingAnimationTracks()) do
        amTrack:Start()
        end
    P1:remove()
    P2:remove()
    P3:remove()
    P4:remove()
    P5:remove()
end
script.Parent.Touched:connect(touch)

Answer this question