Cloning the wrong tool

So I have made a system where if you are a certain rank in the group you are given a certain ticket. The problem is, it keeps giving me the wrong ticket. I know this is very vague but I would like someone to try to find a flaw in my code that makes this happen.

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local debounce = false
local Values = script.Parent.Values
local BusinessClassName = Values.BusinessClassName.Value
local BusinessClassTicket = Values.BusinessClassTicket
local BusinessRank = Values.BusinessRank.Value
local Class3 = Values.Class3.Value
local EconomyClassName = Values.EconomyClassName.Value
local EconomyClassTicket = Values.EconomyClassTicket
local EconomyRank = Values.EconomyRank.Value
local FirstClassName = Values.FirstClassName.Value
local FirstClassTicket = Values.FirstClassTicket
local FirstClassRank = Values.FirstClassRank.Value
local InvestorClassName = Values.InvestorClassName.Value
local InvestorClassTicket = Values.InvestorClassTicket
local InvestorRank = Values.InvestorRank.Value
local groupID = Values.groupID.Value
local Gui = script.Parent:WaitForChild("LoadingGUI")
local GuiClone = Gui:Clone()
GuiClone.Parent = game.ReplicatedStorage



local Brick = script.Parent.SCIParts.Touch

Brick.Touched:Connect(function(hit)
	if debounce then return end
    if hit.Parent:FindFirstChild("Humanoid") then
        local Player = game.Players:GetPlayerFromCharacter(hit.Parent)
	    if Player then	
            local Gui = game.ReplicatedStorage:WaitForChild("LoadingGUI")
            local GuiClone = Gui:Clone()
		    GuiClone.Parent = Player:WaitForChild("PlayerGui")
			    debounce = true
			wait(5)
			if Player:GetRankInGroup(groupID) == EconomyRank then
				local ECT = ReplicatedStorage:WaitForChild(EconomyClassTicket.Value):Clone()
				ECT.Parent = Player:WaitForChild("Backpack")
			else
			if Player:GetRankInGroup(groupID) == BusinessRank  then
					local BCT = ReplicatedStorage:WaitForChild(BusinessClassTicket.Value):Clone()
					BCT.Parent = Player:WaitForChild("Backpack")
			else
			if Player:GetRankInGroup(groupID) == FirstClassRank then
					local FCT = ReplicatedStorage:WaitForChild(FirstClassTicket.Value):Clone()
						FCT.Parent = Player:WaitForChild("Backpack")	
			else			
			if Class3 == false and Player:GetRankInGroup(groupID) == InvestorRank then
				local ICT = ReplicatedStorage:WaitForChild(InvestorClassTicket.Value):Clone()		
						ICT.Parent = Player:WaitForChild("Backpack")
						end
					end			
				end
			end
        end
	end
end)

Thanks.

There is an error here, if not wrong. You should use elseif insetead of else;if. For example:

if player:GetRankInGroup(ID) == 5 then
    --// Something.
elseif player:GetRankInGroup(ID) == 6 then
    --// Something.
elseif player:GetRankInGroup(ID) == 7 then
    --// Something.
end

else alone is usually used for the last possible condition. For example:

if 1 then --// Only 1.
elseif 2 then --// Only 2.
elseif 3 then --// Only 3.
elseif 4 then --// Only 4.
else --// All numbers except for 1,2,3 and 4.
end

Not sure if there are any other errors, but this was the first one that I spotted. :slightly_smiling_face: