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

Have I don this correct?

Asked by
wehosh -1
6 years ago
Edited 6 years ago

---So as long as the stringvalue's value matches the name of the model or gear inside lighting, this should theoretically work. Unless I've done something horribly wrong.

local Suit = game.Lighting.Morphs:findFirstChild(script.Parent.Suit.Value)
local Me = script.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Character
local Weapon = game.Lighting:findFirstChild(script.Parent.Weapon.Value)
local Weapon2 = game.Lighting:findFirstChild(script.Parent.Weapon2.Value)
local Weapon3 = game.Lighting:findFirstChild(script.Parent.Weapon3.Value)
local Player = script.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent

function Click(mouse)
Player.TeamColor = script.Parent.TeamColor.Value
script.Parent.Parent.Parent.Parent.Parent.Visible = false
script.Parent.Parent.Parent.Parent.Parent.Parent.Gui.Visible = true
if Me:findFirstChild("Humanoid") ~= nil and Me:findFirstChild("Arm1") == nil then
omg = math.random(1, 2)
if omg == 1 then
Me:MoveTo(game.Workspace.Map.tele3.Position)
end
if omg == 2 then
Me:MoveTo(game.Workspace.Map.tele.Position)
end
        local g = Suit.Arm1:clone()
        g.Parent = Me
        local C = g:GetChildren()
        for i=1, #C do
            if C[i].className == "Part" then
                local W = Instance.new("Weld")
                W.Part0 = g.Middle
                W.Part1 = C[i]
                local CJ = CFrame.new(g.Middle.Position)
                local C0 = g.Middle.CFrame:inverse()*CJ
                local C1 = C[i].CFrame:inverse()*CJ
                W.C0 = C0
                W.C1 = C1
                W.Parent = g.Middle
            end
                local Y = Instance.new("Weld")
                Y.Part0 = Me["Left Arm"]
                Y.Part1 = g.Middle
                Y.C0 = CFrame.new(0, 0, 0)
                Y.Parent = Y.Part0
        end

        local h = g:GetChildren()
        for i = 1, # h do
            h[i].Anchored = false
            h[i].CanCollide = false
        end

    end

    if Me:findFirstChild("Humanoid") ~= nil and Me:findFirstChild("Arm2") == nil then
        local g = Suit.Arm2:clone()
        g.Parent = Me
        local C = g:GetChildren()
        for i=1, #C do
            if C[i].className == "Part" then
                local W = Instance.new("Weld")
                W.Part0 = g.Middle
                W.Part1 = C[i]
                local CJ = CFrame.new(g.Middle.Position)
                local C0 = g.Middle.CFrame:inverse()*CJ
                local C1 = C[i].CFrame:inverse()*CJ
                W.C0 = C0
                W.C1 = C1
                W.Parent = g.Middle
            end
                local Y = Instance.new("Weld")
                Y.Part0 = Me["Right Arm"]
                Y.Part1 = g.Middle
                Y.C0 = CFrame.new(0, 0, 0)
                Y.Parent = Y.Part0
        end

        local h = g:GetChildren()
        for i = 1, # h do
            h[i].Anchored = false
            h[i].CanCollide = false
        end

    end

    if Me:findFirstChild("Humanoid") ~= nil and Me:findFirstChild("Leg1") == nil then
        local g = Suit.Leg1:clone()
        g.Parent = Me
        local C = g:GetChildren()
        for i=1, #C do
            if C[i].className == "Part" then
                local W = Instance.new("Weld")
                W.Part0 = g.Middle
                W.Part1 = C[i]
                local CJ = CFrame.new(g.Middle.Position)
                local C0 = g.Middle.CFrame:inverse()*CJ
                local C1 = C[i].CFrame:inverse()*CJ
                W.C0 = C0
                W.C1 = C1
                W.Parent = g.Middle
            end
                local Y = Instance.new("Weld")
                Y.Part0 = Me["Left Leg"]
                Y.Part1 = g.Middle
                Y.C0 = CFrame.new(0, 0, 0)
                Y.Parent = Y.Part0
        end

        local h = g:GetChildren()
        for i = 1, # h do
            h[i].Anchored = false
         h[i].CanCollide = false
        end

    end

    if Me:findFirstChild("Humanoid") ~= nil and Me:findFirstChild("Leg2") == nil then
        local g = Suit.Leg2:clone()
        g.Parent = Me
        local C = g:GetChildren()
        for i=1, #C do
            if C[i].className == "Part" then
                local W = Instance.new("Weld")
                W.Part0 = g.Middle
                W.Part1 = C[i]
                local CJ = CFrame.new(g.Middle.Position)
                local C0 = g.Middle.CFrame:inverse()*CJ
                local C1 = C[i].CFrame:inverse()*CJ
                W.C0 = C0
                W.C1 = C1
                W.Parent = g.Middle
            end
                local Y = Instance.new("Weld")
                Y.Part0 = Me["Right Leg"]
                Y.Part1 = g.Middle
                Y.C0 = CFrame.new(0, 0, 0)
                Y.Parent = Y.Part0
        end

        local h = g:GetChildren()
        for i = 1, # h do
            h[i].Anchored = false
         h[i].CanCollide = false
        end

    end
    if Me:findFirstChild("Humanoid") ~= nil and Me:findFirstChild("Chest") == nil then
        local g = Suit.Chest:clone()
        g.Parent = Me
        local C = g:GetChildren()
                local R = Me:GetChildren()
        for i=1, #R do
            if R[i].className == "Hat" then
                R[i]:remove()
            end
        end
        for i=1, #C do
            if C[i].className == "Part" then
                local W = Instance.new("Weld")
                W.Part0 = g.Middle
                W.Part1 = C[i]
                local CJ = CFrame.new(g.Middle.Position)
                local C0 = g.Middle.CFrame:inverse()*CJ
                local C1 = C[i].CFrame:inverse()*CJ
                W.C0 = C0
                W.C1 = C1
                W.Parent = g.Middle
            end
                local Y = Instance.new("Weld")
                Y.Part0 = Me.Torso
                Y.Part1 = g.Middle
                Y.C0 = CFrame.new(0, 0, 0)
                Y.Parent = Y.Part0
        end

        local h = g:GetChildren()
        for i = 1, # h do
            h[i].Anchored = false
            h[i].CanCollide = false
        end

    end
end

script.Parent.MouseButton1Down:connect(Click)

















local debounce = false
local Me2 = script.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Backpack
local evolve = game.Lighting:findFirstChild(script.Parent.Evolve.Value)
local s = game.Lighting.ShopGui
local t = script.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent.stats


function getPlayer(humanoid) 
local players = game.Players:children() 
for i = 1, #players do 
if players[i].Character.Humanoid == humanoid then return players[i] end 
end 
return nil 
end 



function Click2(mouse)
if script.Parent.Parent.Parent.Parent.Parent.Glitch.Value >= 1 then
script.Parent.Parent.Parent.Parent.Parent.Glitch.Value = 0
local human = Me:findFirstChild("Humanoid") 
if (human ~= nil) and debounce == false then

debounce = true

local player = getPlayer(human) 

if (player == nil) then return end 


evolve:clone().Parent = Me2.Parent.PlayerGui
s:clone().Parent = Me2.Parent.PlayerGui
Weapon:clone().Parent = Me2
Weapon2:clone().Parent = Me2
Weapon3:clone().Parent = Me2
t.Type.Value = script.Parent.Type1.Value
t.Type2.Value = script.Parent.Type2.Value

debounce = false
script.Parent.Speed:clone().Parent = Me
Me.Head.Transparency = 0.98
Me.Head.face:remove()
Me.Torso.Transparency = 1
Me:findFirstChild("Right Arm").Transparency = 1
Me:findFirstChild("Left Arm").Transparency = 1
Me:findFirstChild("Right Leg").Transparency = 1
Me:findFirstChild("Left Leg").Transparency = 1
human.WalkSpeed = script.Parent.Speed.Value
human.MaxHealth = script.Parent.Health.Value
human.Health = script.Parent.Health.Value
Me.Shirt:remove()
Me.Pants:remove()
end

end

end


script.Parent.MouseButton1Down:connect(Click2)











0
Test it and find out? TiredMelon 405 — 6y
0
^Lol seith14 206 — 6y

Answer this question