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

Did I add the Code in the wrong place?

Asked by 8 years ago
Edited 8 years ago

I believe I screwed up somewhere, I want it so It puts certain armor on a character if they are on a certain team. But it has to delete their old clothes first. Here

game.Players.PlayerAdded:connect(function(Player) -- Once a player is added Player.CharacterAdded:connect(function() -- Once a Character is added to the Player if Player.TeamColor == game:GetService("Teams")["Lifesucks"] then -- Check their team wait(1) -- Give it a chance to load, now thinking about it ChildAdded might've been better for _,v in pairs(Player.Character:GetChildren()) do -- Gather everything in their Character if v:IsA("Shirt") or v:IsA("Pants") then -- Check if its a shirt or pants v:Destroy() -- If it is, destroy it end -- End the if statement end -- End the for _,v in pairs statement end -- End the if statement end) -- End the CharacterAdded function end) -- End the PlayerAdded function

local Shirt = Instance.new("Shirt",Player.Character) -- Create new shirt local Pants = Instance.new("Pants",Player.Character) -- Create new pants Shirt.ShirtTemplate = "rbxassetid://222862699" Pants.PantsTemplate = "rbxassetid://363587589"-- code here end -- End the if statement end) -- End the PlayerAdded function

0
can you put this in a code block. User#5423 17 — 8y

Answer this question