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

Why Does This Loadout Script Not Function Properly?

Asked by 7 years ago

Why Wont This Script Detect The 4th Loadout Option??

if game.Players.LocalPlayer.TeamColor == BrickColor.new("Dark blue") then
script.Parent.L1.MouseButton1Click:connect(function()
    script.Parent.Visible = false
    local sniper = game.ReplicatedStorage.Weapons.Laser_Rifle:Clone()
    sniper.Parent = game:GetService('Players').LocalPlayer.Backpack
    local sword = game.ReplicatedStorage.Weapons.Energy_Sword:Clone()
    sword.Parent = game:GetService('Players').LocalPlayer.Backpack
end)

script.Parent.L2.MouseButton1Click:connect(function()
    script.Parent.Visible = false
    local sniper = game.ReplicatedStorage.Weapons.Laser_Pistol:Clone()
    sniper.Parent = game:GetService('Players').LocalPlayer.Backpack
    local sword = game.ReplicatedStorage.Weapons.Energy_Sword:Clone()
    sword.Parent = game:GetService('Players').LocalPlayer.Backpack
end)

script.Parent.L3.MouseButton1Click:connect(function()
    script.Parent.Visible = false
    local sniper = game.ReplicatedStorage.Weapons.Laser_Blaster:Clone()
    sniper.Parent = game:GetService('Players').LocalPlayer.Backpack
    local sword = game.ReplicatedStorage.Weapons.Energy_Sword:Clone()
    sword.Parent = game:GetService('Players').LocalPlayer.Backpack
end)

script.Parent.L4.MouseButton1Click:connect(function()
    script.Parent.Visible = false
    local sniper = game.ReplicatedStorage.Weapons.Laser_Eagle:Clone()
    sniper.Parent = game:GetService('Players').LocalPlayer.Backpack
    local sword = game.ReplicatedStorage.Weapons.Energy_Sword:Clone()
    sword.Parent = game:GetService('Players').LocalPlayer.Backpack
end)
end

if game.Players.LocalPlayer.TeamColor == BrickColor.new("Really red") then
script.Parent.L1.MouseButton1Click:connect(function()
    script.Parent.Visible = false
    local sniper = game.ReplicatedStorage.Weapons.L86:Clone()
    sniper.Parent = game:GetService('Players').LocalPlayer.Backpack
end)

script.Parent.L2.MouseButton1Click:connect(function()
    script.Parent.Visible = false
    local sniper = game.ReplicatedStorage.Weapons.M16A1:Clone()
    sniper.Parent = game:GetService('Players').LocalPlayer.Backpack
end)

script.Parent.L3.MouseButton1Click:connect(function()
    script.Parent.Visible = false
    local sniper = game.ReplicatedStorage.Weapons.M16A4:Clone()
    sniper.Parent = game:GetService('Players').LocalPlayer.Backpack
end)

script.Parent.L4.MouseButton1Click:connect(function()
    script.Parent.Visible = false
    local sniper = game.ReplicatedStorage.Weapons.TMP:Clone()
    sniper.Parent = game:GetService('Players').LocalPlayer.Backpack
end)
end

Answer this question