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

So, why isnt this working?

Asked by
Vritix 0
10 years ago

I have this script, I want to give secuirty+ a tool, but It wont let me give a speific tool to that rank.

Where do I put what rank gets the tool?

--[[
Instructions
1. Put The Configuration with the name 'Group Tools' in Lighting
2. Add tools to the correct bin     The bin with the name '0' is for Private +
                                                So the bin with the name '12' is for The Lord
3. Have fun

Warning, do not insert double tools so not a gun in bin '0' and in bin '2'
            otherwise the Corporal gets 2 guns.
--]]

local GroupId = 351251   -- 351251 is the Zeralian GroupId.

game.Players.PlayerAdded:connect(function(Player)

    if Player:GetRankInGroup(GroupId) >= 0 then
        Player.CharacterAdded:connect(function(Character)
            local Weps = game.Lighting["Group Tools"]["0"]:GetChildren()
            for i = 1, #Weps do
                local Clone = Weps[i]:Clone()
                Clone.Parent = game.Players:GetPlayerFromCharacter(Character).Backpack
            end
        end)
    end
    if Player:GetRankInGroup(GroupId) >= 1 then
        Player.CharacterAdded:connect(function(Character)
            local Weps = game.Lighting["Group Tools"]["1"]:GetChildren()
            for i = 1, #Weps do
                local Clone = Weps[i]:Clone()
                Clone.Parent = game.Players:GetPlayerFromCharacter(Character).Backpack
            end
        end)
    end
    if Player:GetRankInGroup(GroupId) >= 2 then
        Player.CharacterAdded:connect(function(Character)
            local Weps = game.Lighting["Group Tools"]["2"]:GetChildren()
            for i = 1, #Weps do
                local Clone = Weps[i]:Clone()
                Clone.Parent = game.Players:GetPlayerFromCharacter(Character).Backpack
            end
        end)
    end
    if Player:GetRankInGroup(GroupId) >= 3 then
        Player.CharacterAdded:connect(function(Character)
            local Weps = game.Lighting["Group Tools"]["3"]:GetChildren()
            for i = 1, #Weps do
                local Clone = Weps[i]:Clone()
                Clone.Parent = game.Players:GetPlayerFromCharacter(Character).Backpack
            end
        end)
    end
    if Player:GetRankInGroup(GroupId) >= 4 then
        Player.CharacterAdded:connect(function(Character)
            local Weps = game.Lighting["Group Tools"]["4"]:GetChildren()
            for i = 1, #Weps do
                local Clone = Weps[i]:Clone()
                Clone.Parent = game.Players:GetPlayerFromCharacter(Character).Backpack
            end
        end)
    end
    if Player:GetRankInGroup(GroupId) >= 5 then
        Player.CharacterAdded:connect(function(Character)
            local Weps = game.Lighting["Group Tools"]["5"]:GetChildren()
            for i = 1, #Weps do
                local Clone = Weps[i]:Clone()
                Clone.Parent = game.Players:GetPlayerFromCharacter(Character).Backpack
            end
        end)
    end
    if Player:GetRankInGroup(GroupId) >= 6 then
        Player.CharacterAdded:connect(function(Character)
            local Weps = game.Lighting["Group Tools"]["6"]:GetChildren()
            for i = 1, #Weps do
                local Clone = Weps[i]:Clone()
                Clone.Parent = game.Players:GetPlayerFromCharacter(Character).Backpack
            end
        end)
    end
    if Player:GetRankInGroup(GroupId) >= 7 then
        Player.CharacterAdded:connect(function(Character)
            local Weps = game.Lighting["Group Tools"]["7"]:GetChildren()
            for i = 1, #Weps do
                local Clone = Weps[i]:Clone()
                Clone.Parent = game.Players:GetPlayerFromCharacter(Character).Backpack
            end
        end)
    end
    if Player:GetRankInGroup(GroupId) >= 8 then
        Player.CharacterAdded:connect(function(Character)
            local Weps = game.Lighting["Group Tools"]["8"]:GetChildren()
            for i = 1, #Weps do
                local Clone = Weps[i]:Clone()
                Clone.Parent = game.Players:GetPlayerFromCharacter(Character).Backpack
            end
        end)
    end
    if Player:GetRankInGroup(GroupId) >= 9 then
        Player.CharacterAdded:connect(function(Character)
            local Weps = game.Lighting["Group Tools"]["9"]:GetChildren()
            for i = 1, #Weps do
                local Clone = Weps[i]:Clone()
                Clone.Parent = game.Players:GetPlayerFromCharacter(Character).Backpack
            end
        end)
    end
    if Player:GetRankInGroup(GroupId) >= 10 then
        Player.CharacterAdded:connect(function(Character)
            local Weps = game.Lighting["Group Tools"]["10"]:GetChildren()
            for i = 1, #Weps do
                local Clone = Weps[i]:Clone()
                Clone.Parent = game.Players:GetPlayerFromCharacter(Character).Backpack
            end
        end)
    end
    if Player:GetRankInGroup(GroupId) >= 11 then
        Player.CharacterAdded:connect(function(Character)
            local Weps = game.Lighting["Group Tools"]["11"]:GetChildren()
            for i = 1, #Weps do
                local Clone = Weps[i]:Clone()
                Clone.Parent = game.Players:GetPlayerFromCharacter(Character).Backpack
            end
        end)
    end
    if Player:GetRankInGroup(GroupId) >= 12 then
        Player.CharacterAdded:connect(function(Character)
            local Weps = game.Lighting["Group Tools"]["12"]:GetChildren()
            for i = 1, #Weps do
                local Clone = Weps[i]:Clone()
                Clone.Parent = game.Players:GetPlayerFromCharacter(Character).Backpack
            end
        end)
    end

end)

Answer this question