Script not running all the way through second time it is ran

Hey Developers! I have a script that gives the player tools and puts a morph on the character as a mobile task force unit from SCPF. It gives the player tools, and changes the uniform but it stops after changing the uniform and does not get all the children of the folder to apply to. The script works correctly as supposed to first time, but if you reset or respawn your tools load, but not your morph. Here is the script:

Area 25 - Roblox Studio 2_25_2021 9_10_51 AM (2)

The script runs to the line:
pants.Parent = player.Character

As I said, the entire script runs the first time you load in or change your team, but if you respawn to let the morph load again, it only loads to the line of code mentioned above. Thanks for reading, any help would contribute!

Cosmo

Edit: Custom inventory is implemented so you fire the event with the tool to put it into the inventory.

Maybe:

Humanoid.Died:Connect(function()
-- Code here
end)

What code could I put in that block to help? I’m not sure that would fix the issue, sorry.

This may not work but maybe do the same thing you do when they change their teams.
Give them the clothing/items

Doesn’t work, I just implemented it. It’s rather peculiar that the code I used before doesn’t work.

You need to check when the Player.CharacterAdded function is run. Humanoid.Died will run when the Character dies, not when it respawns, so you were giving things to a dead Character.

From the image posted, you should put the CharacterAdded function at the very top, above the rank == 255 part.

1 Like

It is already checking when the player is ran, that is not the full script, this is:

game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function()
	wait()
	if player.Team == game.Teams["Administrative Department"] then
		
	end
	if player.Team == game.Teams["Chaos Insurgency"] then
		
	end
	if player.Team == game.Teams["Class Disposal"] then
		
	end
	if player.Team == game.Teams["Combat Medics"] then
		
	end
	if player.Team == game.Teams["Department of External Affairs"] then
		
	end
	if player.Team == game.Teams["Engineering & Technical Department"] then
		
	end
	if player.Team == game.Teams["Ethics Comittee"] then
		
	end
	if player.Team == game.Teams["Foundation Personnel"] then
		
	end
	if player.Team == game.Teams["Intelligence Agency"] then
		
	end
	if player.Team == game.Teams["Internal Security Department"] then
		
	end
	if player.Team == game.Teams["Management Department"] then
		
	end
	if player.Team == game.Teams["Medical Department"] then
		
	end
	if player.Team == game.Teams["Mobile Task Force"] then
		wait(1)
		local rank = player:GetRankInGroup(8547485)
		if rank == 1 then
			-- Nine Tailed Fox
			wait(1)
			for _,part in pairs(player.Character:GetChildren()) do
				if part:IsA("BasePart") then
					part.Color = Color3.fromRGB(17,17,17)
				end
			end
			local Radio = game.ReplicatedStorage.Tools.Other.Radio:Clone()
			local Bandages = game.ReplicatedStorage.Tools.Other.Bandages:Clone()
			local ACR = game.ReplicatedStorage.Tools.Guns.ACR:Clone()
			local Detain = game.ReplicatedStorage.Tools.Other.Detain:Clone()
			local Shield = game.ReplicatedStorage.Tools.Other["Riot Shield"]:Clone()
			local RPD = game.ReplicatedStorage.Tools.Guns.RPD:Clone()
			local G17 = game.ReplicatedStorage.Tools.Guns.G17:Clone()
			player.PlayerGui.CustomInventory.Give:Fire(Radio)
			player.PlayerGui.CustomInventory.Give:Fire(Bandages)
			player.PlayerGui.CustomInventory.Give:Fire(ACR)
			player.PlayerGui.CustomInventory.Give:Fire(Detain)
			player.PlayerGui.CustomInventory.Give:Fire(RPD)
			player.PlayerGui.CustomInventory.Give:Fire(G17)
			for _,remove in pairs(player.Character:GetChildren()) do
				if remove.ClassName == "Accessory" or remove.ClassName == "Shirt" or remove.ClassName == "Pants" then
					remove:Destroy()
				end
			end
			local shirt = script.MTF_Top:Clone()
			local pants = script.MTF_Bottom:Clone()
			shirt.Parent = player.Character
			pants.Parent = player.Character
			for _,accessory in pairs(game.ReplicatedStorage.Morphs.MTF.Epsilon:GetChildren()) do
				if accessory.ClassName == "Model" then
					accessory:Clone()
					accessory.Parent = player.Character
					accessory.Name = "AccessoryModel"
					for _,motor6d in pairs(accessory:GetDescendants()) do
						if motor6d.ClassName == "Motor6D" then
							if player.Character:FindFirstChild(motor6d.Name) then
								motor6d.Part1 = player.Character:FindFirstChild(motor6d.Name)
							end
						end
					end
				end
			end
		end
		if rank == 2 then
			-- Maz Hatters
			wait(1)
			for _,part in pairs(player.Character:GetChildren()) do
				if part:IsA("BasePart") then
					part.Color = Color3.fromRGB(17,17,17)
				end
			end
			local Radio = game.ReplicatedStorage.Tools.Other.Radio:Clone()
			local Bandages = game.ReplicatedStorage.Tools.Other.Bandages:Clone()
			local TAR = game.ReplicatedStorage.Tools.Guns["TAR-21"]:Clone()
			local Medibag = game.ReplicatedStorage.Tools.Other.Medibag:Clone()
			local Shield = game.ReplicatedStorage.Tools.Other["Riot Shield"]:Clone()
			local G17 = game.ReplicatedStorage.Tools.Guns.G17:Clone()
			local Detain = game.ReplicatedStorage.Tools.Other.Detain:Clone()
			player.PlayerGui.CustomInventory.Give:Fire(Radio)
			player.PlayerGui.CustomInventory.Give:Fire(Bandages)
			player.PlayerGui.CustomInventory.Give:Fire(TAR)
			player.PlayerGui.CustomInventory.Give:Fire(Medibag)
			player.PlayerGui.CustomInventory.Give:Fire(Shield)
			player.PlayerGui.CustomInventory.Give:Fire(G17)
			player.PlayerGui.CustomInventory.Give:Fire(Detain)
			for _,remove in pairs(player.Character:GetChildren()) do
				if remove.ClassName == "Accessory" or remove.ClassName == "Shirt" or remove.ClassName == "Pants" then
					remove:Destroy()
				end
			end
			local shirt = script.MTF_Top:Clone()
			local pants = script.MTF_Bottom:Clone()
			shirt.Parent = player.Character
			pants.Parent = player.Character
			for _,accessory in pairs(game.ReplicatedStorage.Morphs.MTF.Beta:GetChildren()) do
				if accessory.ClassName == "Model" then
					accessory:Clone()
					accessory.Parent = player.Character
					accessory.Name = "AccessoryModel"
					for _,motor6d in pairs(accessory:GetDescendants()) do
						if motor6d.ClassName == "Motor6D" then
							if player.Character:FindFirstChild(motor6d.Name) then
								motor6d.Part1 = player.Character:FindFirstChild(motor6d.Name)
							end
						end
					end
				end
			end
		end
		if rank == 3 then
			-- Red right hand
			wait(1)
			for _,part in pairs(player.Character:GetChildren()) do
				if part:IsA("BasePart") then
					part.Color = Color3.fromRGB(17,17,17)
				end
			end
			local Radio = game.ReplicatedStorage.Tools.Other.Radio:Clone()
			local AlphaDetain = game.ReplicatedStorage.Tools.Other["Alpha Detain"]:Clone()
			local G36C = game.ReplicatedStorage.Tools.Guns.G36C:Clone()
			local AlphaShield = game.ReplicatedStorage.Tools.Other["Alpha Shield"]:Clone()
			local Medibag = game.ReplicatedStorage.Tools.Other.Medibag:Clone()
			local Detain = game.ReplicatedStorage.Tools.Other.Detain:Clone()
			local M60 = game.ReplicatedStorage.Tools.Guns.M60:Clone()
			local G18 = game.ReplicatedStorage.Tools.Guns.G18:Clone()
			player.PlayerGui.CustomInventory.Give:Fire(Radio)
			player.PlayerGui.CustomInventory.Give:Fire(AlphaDetain)
			player.PlayerGui.CustomInventory.Give:Fire(G36C)
			player.PlayerGui.CustomInventory.Give:Fire(AlphaShield)
			player.PlayerGui.CustomInventory.Give:Fire(Medibag)
			player.PlayerGui.CustomInventory.Give:Fire(Detain)
			player.PlayerGui.CustomInventory.Give:Fire(M60)
			player.PlayerGui.CustomInventory.Give:Fire(G18)
			wait(1)
			for _,remove in pairs(player.Character:GetChildren()) do
				if remove.ClassName == "Accessory" or remove.ClassName == "Shirt" or remove.ClassName == "Pants" then
					remove:Destroy()
				end
			end
			local shirt = script.MTF_Top:Clone()
			local pants = script.MTF_Bottom:Clone()
			shirt.Parent = player.Character
			pants.Parent = player.Character
			for _,accessory in pairs(game.ReplicatedStorage.Morphs.MTF.Alpha:GetChildren()) do
				if accessory.ClassName == "Model" then
					accessory:Clone()
					accessory.Parent = player.Character
					accessory.Name = "AccessoryModel"
					for _,motor6d in pairs(accessory:GetDescendants()) do
						if motor6d.ClassName == "Motor6D" then
							if player.Character:FindFirstChild(motor6d.Name) then
								motor6d.Part1 = player.Character:FindFirstChild(motor6d.Name)
							end
						end
					end
				end
			end
		end
		if rank == 4 then
			-- Front runners
			wait(1)
			for _,part in pairs(player.Character:GetChildren()) do
				if part:IsA("BasePart") then
					part.Color = Color3.fromRGB(17,17,17)
				end
			end
			local Radio = game.ReplicatedStorage.Tools.Other.Radio:Clone()
			local Bandages = game.ReplicatedStorage.Tools.Other.Bandages:Clone()
			local SCAR = game.ReplicatedStorage.Tools.Guns["SCAR-H"]:Clone()
			local Medibag = game.ReplicatedStorage.Tools.Other.Medibag:Clone()
			local Detain = game.ReplicatedStorage.Tools.Other.Detain:Clone()
			local G17 = game.ReplicatedStorage.Tools.Guns.G17:Clone()
			player.PlayerGui.CustomInventory.Give:Fire(Radio)
			player.PlayerGui.CustomInventory.Give:Fire(Bandages)
			player.PlayerGui.CustomInventory.Give:Fire(SCAR)
			player.PlayerGui.CustomInventory.Give:Fire(Medibag)
			player.PlayerGui.CustomInventory.Give:Fire(Detain)
			player.PlayerGui.CustomInventory.Give:Fire(G17)
			for _,remove in pairs(player.Character:GetChildren()) do
				if remove.ClassName == "Accessory" or remove.ClassName == "Shirt" or remove.ClassName == "Pants" then
					remove:Destroy()
				end
			end
			local shirt = script.MTF_Top:Clone()
			local pants = script.MTF_Bottom:Clone()
			shirt.Parent = player.Character
			pants.Parent = player.Character
			for _,accessory in pairs(game.ReplicatedStorage.Morphs.MTF.Delta:GetChildren()) do
				if accessory.ClassName == "Model" then
					accessory:Clone()
					accessory.Parent = player.Character
					accessory.Name = "AccessoryModel"
					for _,motor6d in pairs(accessory:GetDescendants()) do
						if motor6d.ClassName == "Motor6D" then
							if player.Character:FindFirstChild(motor6d.Name) then
								motor6d.Part1 = player.Character:FindFirstChild(motor6d.Name)
							end
						end
					end
				end
			end
		end
		if rank == 5 then
			-- Omicron
			wait(1)
			for _,part in pairs(player.Character:GetChildren()) do
				if part:IsA("BasePart") then
					part.Color = Color3.fromRGB(17,17,17)
				end
			end
			local Radio = game.ReplicatedStorage.Tools.Other.Radio:Clone()
			local Bandages = game.ReplicatedStorage.Tools.Other.Bandages:Clone()
			local Bizon = game.ReplicatedStorage.Tools.Guns["PP-19 Bizon"]:Clone()
			local M60 = game.ReplicatedStorage.Tools.Guns.M60:Clone()
			local RPD = game.ReplicatedStorage.Tools.Guns.RPD:Clone()
			local Detain = game.ReplicatedStorage.Tools.Other.Detain:Clone()
			player.PlayerGui.CustomInventory.Give:Fire(Radio)
			player.PlayerGui.CustomInventory.Give:Fire(Bandages)
			player.PlayerGui.CustomInventory.Give:Fire(Bizon)
			player.PlayerGui.CustomInventory.Give:Fire(M60)
			player.PlayerGui.CustomInventory.Give:Fire(RPD)
			player.PlayerGui.CustomInventory.Give:Fire(Detain)
			for _,remove in pairs(player.Character:GetChildren()) do
				if remove.ClassName == "Accessory" or remove.ClassName == "Shirt" or remove.ClassName == "Pants" then
					remove:Destroy()
				end
			end
			local shirt = script.MTF_Top:Clone()
			local pants = script.MTF_Bottom:Clone()
			shirt.Parent = player.Character
			pants.Parent = player.Character
			for _,accessory in pairs(game.ReplicatedStorage.Morphs.MTF.Omicron:GetChildren()) do
				if accessory.ClassName == "Model" then
					accessory:Clone()
					accessory.Parent = player.Character
					accessory.Name = "AccessoryModel"
					for _,motor6d in pairs(accessory:GetDescendants()) do
						if motor6d.ClassName == "Motor6D" then
							if player.Character:FindFirstChild(motor6d.Name) then
								motor6d.Part1 = player.Character:FindFirstChild(motor6d.Name)
							end
						end
					end
				end
			end
		end
		if rank == 6 then
			-- Task Force Sergeant
			wait(1)
			for _,part in pairs(player.Character:GetChildren()) do
				if part:IsA("BasePart") then
					part.Color = Color3.fromRGB(17,17,17)
				end
			end
			local Radio = game.ReplicatedStorage.Tools.Other.Radio:Clone()
			local Bandages = game.ReplicatedStorage.Tools.Other.Bandages:Clone()
			local G36C = game.ReplicatedStorage.Tools.Guns.G36C:Clone()
			local Bizon = game.ReplicatedStorage.Tools.Guns["PP-19 Bizon"]:Clone()
			local Medibag = game.ReplicatedStorage.Tools.Other.Medibag:Clone()
			local AlphaShield = game.ReplicatedStorage.Tools.Other["Alpha Shield"]:Clone()
			local AlphaDetain = game.ReplicatedStorage.Tools.Other["Alpha Detain"]:Clone()
			local Detain = game.ReplicatedStorage.Tools.Other.Detain:Clone()
			local Shield = game.ReplicatedStorage.Tools.Other["Riot Shield"]:Clone()
			local M60 = game.ReplicatedStorage.Tools.Guns.M60:Clone()
			player.PlayerGui.CustomInventory.Give:Fire(Radio)
			player.PlayerGui.CustomInventory.Give:Fire(Bandages)
			player.PlayerGui.CustomInventory.Give:Fire(G36C)
			player.PlayerGui.CustomInventory.Give:Fire(Bizon)
			player.PlayerGui.CustomInventory.Give:Fire(Medibag)
			player.PlayerGui.CustomInventory.Give:Fire(AlphaShield)
			player.PlayerGui.CustomInventory.Give:Fire(AlphaDetain)
			player.PlayerGui.CustomInventory.Give:Fire(Detain)
			player.PlayerGui.CustomInventory.Give:Fire(Shield)
			player.PlayerGui.CustomInventory.Give:Fire(M60)
			for _,remove in pairs(player.Character:GetChildren()) do
				if remove.ClassName == "Accessory" or remove.ClassName == "Shirt" or remove.ClassName == "Pants" then
					remove:Destroy()
				end
			end
			local shirt = script.MTF_Top:Clone()
			shirt.Parent = player.Character
			local pants = script.MTF_Bottom:Clone()
			pants.Parent = player.Character
			for _,accessory in pairs(game.ReplicatedStorage.Morphs.MTF.TFS:GetChildren()) do
				if accessory.ClassName == "Model" then
					accessory:Clone()
					accessory.Parent = player.Character
					accessory.Name = "AccessoryModel"
					for _,motor6d in pairs(accessory:GetDescendants()) do
						if motor6d.ClassName == "Motor6D" then
							if player.Character:FindFirstChild(motor6d.Name) then
								motor6d.Part1 = player.Character:FindFirstChild(motor6d.Name)
							end
						end
					end
				end
			end
		end
		if rank == 7 then
			-- Task Force Leader
			wait(1)
			local Radio = game.ReplicatedStorage.Tools.Other.Radio:Clone()
			local Bandages = game.ReplicatedStorage.Tools.Other.Bandages:Clone()
			local G36C = game.ReplicatedStorage.Tools.Guns.G36C:Clone()
			local Bizon = game.ReplicatedStorage.Tools.Guns["PP-19 Bizon"]:Clone()
			local Medibag = game.ReplicatedStorage.Tools.Other.Medibag:Clone()
			local AlphaShield = game.ReplicatedStorage.Tools.Other["Alpha Shield"]:Clone()
			local AlphaDetain = game.ReplicatedStorage.Tools.Other["Alpha Detain"]:Clone()
			local Detain = game.ReplicatedStorage.Tools.Other.Detain:Clone()
			local Shield = game.ReplicatedStorage.Tools.Other["Riot Shield"]:Clone()
			local M60 = game.ReplicatedStorage.Tools.Guns.M60:Clone()
			player.PlayerGui.CustomInventory.Give:Fire(Radio)
			player.PlayerGui.CustomInventory.Give:Fire(Bandages)
			player.PlayerGui.CustomInventory.Give:Fire(G36C)
			player.PlayerGui.CustomInventory.Give:Fire(Bizon)
			player.PlayerGui.CustomInventory.Give:Fire(Medibag)
			player.PlayerGui.CustomInventory.Give:Fire(AlphaShield)
			player.PlayerGui.CustomInventory.Give:Fire(AlphaDetain)
			player.PlayerGui.CustomInventory.Give:Fire(Detain)
			player.PlayerGui.CustomInventory.Give:Fire(Shield)
			player.PlayerGui.CustomInventory.Give:Fire(M60)
			for _,remove in pairs(player.Character:GetChildren()) do
				if remove.ClassName == "Accessory" or remove.ClassName == "Shirt" or remove.ClassName == "Pants" then
					remove:Destroy()
				end
			end
			local shirt = script.MTF_Top:Clone()
			local pants = script.MTF_Bottom:Clone()
			shirt.Parent = player.Character
			pants.Parent = player.Character
			for _,accessory in pairs(game.ReplicatedStorage.Morphs.MTF.TFL:GetChildren()) do
				if accessory.ClassName == "Model" then
					accessory:Clone()
					accessory.Parent = player.Character
					accessory.Name = "AccessoryModel"
					for _,motor6d in pairs(accessory:GetDescendants()) do
						if motor6d.ClassName == "Motor6D" then
							if player.Character:FindFirstChild(motor6d.Name) then
								motor6d.Part1 = player.Character:FindFirstChild(motor6d.Name)
							end
						end
					end
				end
			end
		end
		if rank == 8 then
			-- Assistant Director
			wait(1)
			local Radio = game.ReplicatedStorage.Tools.Other.Radio:Clone()
			local Bandages = game.ReplicatedStorage.Tools.Other.Bandages:Clone()
			local G36C = game.ReplicatedStorage.Tools.Guns.G36C:Clone()
			local Bizon = game.ReplicatedStorage.Tools.Guns["PP-19 Bizon"]:Clone()
			local Medibag = game.ReplicatedStorage.Tools.Other.Medibag:Clone()
			local AlphaShield = game.ReplicatedStorage.Tools.Other["Alpha Shield"]:Clone()
			local AlphaDetain = game.ReplicatedStorage.Tools.Other["Alpha Detain"]:Clone()
			local Detain = game.ReplicatedStorage.Tools.Other.Detain:Clone()
			local Shield = game.ReplicatedStorage.Tools.Other["Riot Shield"]:Clone()
			local M60 = game.ReplicatedStorage.Tools.Guns.M60:Clone()
			player.PlayerGui.CustomInventory.Give:Fire(Radio)
			player.PlayerGui.CustomInventory.Give:Fire(Bandages)
			player.PlayerGui.CustomInventory.Give:Fire(G36C)
			player.PlayerGui.CustomInventory.Give:Fire(Bizon)
			player.PlayerGui.CustomInventory.Give:Fire(Medibag)
			player.PlayerGui.CustomInventory.Give:Fire(AlphaShield)
			player.PlayerGui.CustomInventory.Give:Fire(AlphaDetain)
			player.PlayerGui.CustomInventory.Give:Fire(Detain)
			player.PlayerGui.CustomInventory.Give:Fire(Shield)
			player.PlayerGui.CustomInventory.Give:Fire(M60)
			for _,remove in pairs(player.Character:GetChildren()) do
				if remove.ClassName == "Accessory" or remove.ClassName == "Shirt" or remove.ClassName == "Pants" then
					remove:Destroy()
				end
			end
			local shirt = script.MTF_Top:Clone()
			local pants = script.MTF_Bottom:Clone()
			shirt.Parent = player.Character
			pants.Parent = player.Character
			for _,accessory in pairs(game.ReplicatedStorage.Morphs.MTF.Assistant:GetChildren()) do
				if accessory.ClassName == "Model" then
					accessory:Clone()
					accessory.Parent = player.Character
					accessory.Name = "AccessoryModel"
					for _,motor6d in pairs(accessory:GetDescendants()) do
						if motor6d.ClassName == "Motor6D" then
							if player.Character:FindFirstChild(motor6d.Name) then
								motor6d.Part1 = player.Character:FindFirstChild(motor6d.Name)
							end
						end
					end
				end
			end
		end
		if rank == 9 then
			-- Director
			wait(1)
			local Radio = game.ReplicatedStorage.Tools.Other.Radio:Clone()
			local Bandages = game.ReplicatedStorage.Tools.Other.Bandages:Clone()
			local G36C = game.ReplicatedStorage.Tools.Guns.G36C:Clone()
			local Bizon = game.ReplicatedStorage.Tools.Guns["PP-19 Bizon"]:Clone()
			local Medibag = game.ReplicatedStorage.Tools.Other.Medibag:Clone()
			local AlphaShield = game.ReplicatedStorage.Tools.Other["Alpha Shield"]:Clone()
			local AlphaDetain = game.ReplicatedStorage.Tools.Other["Alpha Detain"]:Clone()
			local Detain = game.ReplicatedStorage.Tools.Other.Detain:Clone()
			local Shield = game.ReplicatedStorage.Tools.Other["Riot Shield"]:Clone()
			local M60 = game.ReplicatedStorage.Tools.Guns.M60:Clone()
			player.PlayerGui.CustomInventory.Give:Fire(Radio)
			player.PlayerGui.CustomInventory.Give:Fire(Bandages)
			player.PlayerGui.CustomInventory.Give:Fire(G36C)
			player.PlayerGui.CustomInventory.Give:Fire(Bizon)
			player.PlayerGui.CustomInventory.Give:Fire(Medibag)
			player.PlayerGui.CustomInventory.Give:Fire(AlphaShield)
			player.PlayerGui.CustomInventory.Give:Fire(AlphaDetain)
			player.PlayerGui.CustomInventory.Give:Fire(Detain)
			player.PlayerGui.CustomInventory.Give:Fire(Shield)
			player.PlayerGui.CustomInventory.Give:Fire(M60)
			for _,remove in pairs(player.Character:GetChildren()) do
				if remove.ClassName == "Accessory" or remove.ClassName == "Shirt" or remove.ClassName == "Pants" then
					remove:Destroy()
				end
			end
			local shirt = script.MTF_Top:Clone()
			local pants = script.MTF_Bottom:Clone()
			shirt.Parent = player.Character
			pants.Parent = player.Character
			for _,accessory in pairs(game.ReplicatedStorage.Morphs.MTF.Director:GetChildren()) do
				if accessory.ClassName == "Model" then
					accessory:Clone()
					accessory.Parent = player.Character
					accessory.Name = "AccessoryModel"
					for _,motor6d in pairs(accessory:GetDescendants()) do
						if motor6d.ClassName == "Motor6D" then
							if player.Character:FindFirstChild(motor6d.Name) then
								motor6d.Part1 = player.Character:FindFirstChild(motor6d.Name)
							end
						end
					end
				end
			end
		end
		if rank == 254 then
			-- Overseer
			wait(1)
			local Radio = game.ReplicatedStorage.Tools.Other.Radio:Clone()
			local Bandages = game.ReplicatedStorage.Tools.Other.Bandages:Clone()
			local G36C = game.ReplicatedStorage.Tools.Guns.G36C:Clone()
			local Bizon = game.ReplicatedStorage.Tools.Guns["PP-19 Bizon"]:Clone()
			local Medibag = game.ReplicatedStorage.Tools.Other.Medibag:Clone()
			local AlphaShield = game.ReplicatedStorage.Tools.Other["Alpha Shield"]:Clone()
			local AlphaDetain = game.ReplicatedStorage.Tools.Other["Alpha Detain"]:Clone()
			local Detain = game.ReplicatedStorage.Tools.Other.Detain:Clone()
			local Shield = game.ReplicatedStorage.Tools.Other["Riot Shield"]:Clone()
			local M60 = game.ReplicatedStorage.Tools.Guns.M60:Clone()
			player.PlayerGui.CustomInventory.Give:Fire(Radio)
			player.PlayerGui.CustomInventory.Give:Fire(Bandages)
			player.PlayerGui.CustomInventory.Give:Fire(G36C)
			player.PlayerGui.CustomInventory.Give:Fire(Bizon)
			player.PlayerGui.CustomInventory.Give:Fire(Medibag)
			player.PlayerGui.CustomInventory.Give:Fire(AlphaShield)
			player.PlayerGui.CustomInventory.Give:Fire(AlphaDetain)
			player.PlayerGui.CustomInventory.Give:Fire(Detain)
			player.PlayerGui.CustomInventory.Give:Fire(Shield)
			player.PlayerGui.CustomInventory.Give:Fire(M60)
			for _,remove in pairs(player.Character:GetChildren()) do
				if remove.ClassName == "Accessory" or remove.ClassName == "Shirt" or remove.ClassName == "Pants" then
					remove:Destroy()
				end
			end
			local shirt = script.MTF_Top:Clone()
			local pants = script.MTF_Bottom:Clone()
			shirt.Parent = player.Character
			pants.Parent = player.Character
			for _,accessory in pairs(game.ReplicatedStorage.Morphs.MTF.Overseer:GetChildren()) do
				if accessory.ClassName == "Model" then
					accessory:Clone()
					accessory.Parent = player.Character
					accessory.Name = "AccessoryModel"
					for _,motor6d in pairs(accessory:GetDescendants()) do
						if motor6d.ClassName == "Motor6D" then
							if player.Character:FindFirstChild(motor6d.Name) then
								motor6d.Part1 = player.Character:FindFirstChild(motor6d.Name)
							end
						end
					end
				end
			end
		end
		if rank == 255 then
			-- Administrator
			wait(1)
			for _,part in pairs(player.Character:GetChildren()) do
				if part:IsA("BasePart") then
					part.Color = Color3.fromRGB(17,17,17)
				end
			end
			local Radio = game.ReplicatedStorage.Tools.Other.Radio:Clone()
			local Bandages = game.ReplicatedStorage.Tools.Other.Bandages:Clone()
			local G36C = game.ReplicatedStorage.Tools.Guns.G36C:Clone()
			local Bizon = game.ReplicatedStorage.Tools.Guns["PP-19 Bizon"]:Clone()
			local Medibag = game.ReplicatedStorage.Tools.Other.Medibag:Clone()
			local AlphaShield = game.ReplicatedStorage.Tools.Other["Alpha Shield"]:Clone()
			local AlphaDetain = game.ReplicatedStorage.Tools.Other["Alpha Detain"]:Clone()
			local Detain = game.ReplicatedStorage.Tools.Other.Detain:Clone()
			local Shield = game.ReplicatedStorage.Tools.Other["Riot Shield"]:Clone()
			local M60 = game.ReplicatedStorage.Tools.Guns.M60:Clone()
			player.PlayerGui.CustomInventory.Give:Fire(Radio)
			player.PlayerGui.CustomInventory.Give:Fire(Bandages)
			player.PlayerGui.CustomInventory.Give:Fire(G36C)
			player.PlayerGui.CustomInventory.Give:Fire(Bizon)
			player.PlayerGui.CustomInventory.Give:Fire(Medibag)
			player.PlayerGui.CustomInventory.Give:Fire(AlphaShield)
			player.PlayerGui.CustomInventory.Give:Fire(AlphaDetain)
			player.PlayerGui.CustomInventory.Give:Fire(Detain)
			player.PlayerGui.CustomInventory.Give:Fire(Shield)
			player.PlayerGui.CustomInventory.Give:Fire(M60)
			for _,remove in pairs(player.Character:GetChildren()) do
				if remove.ClassName == "Accessory" or remove.ClassName == "Shirt" or remove.ClassName == "Pants" then
					remove:Destroy()
				end
			end
			local shirt = script.MTF_Top:Clone()
			local pants = script.MTF_Bottom:Clone()
			shirt.Parent = player.Character
			pants.Parent = player.Character
			for _,accessory in pairs(game.ReplicatedStorage.Morphs.MTF.Administrator:GetChildren()) do
				if accessory.ClassName == "Model" then
					accessory:Clone()
					accessory.Parent = player.Character
					accessory.Name = "AccessoryModel"
					for _,motor6d in pairs(accessory:GetDescendants()) do
						if motor6d.ClassName == "Motor6D" then
							if player.Character:FindFirstChild(motor6d.Name) then
								motor6d.Part1 = player.Character:FindFirstChild(motor6d.Name)
							end
						end
					end
				end
			end
		end
	end
	if player.Team == game.Teams["Organization Department"] then
		
	end
	if player.Team == game.Teams["Rapid Response Team"] then
		
	if player.Team == game.Teams["Scientific Department"] then
	end
		
	end
	if player.Team == game.Teams["Security Department"] then
		
	end
end)
 end)

Edit: I’m new to indenting sorry

1 Like

idk if this helps but you can do this to get character without the character having to spawn in:

game.Players.PlayerAdded:Connect(function(player)

local character = game.Workspace:WaitForChild(player.Name)

end)