I don’t know what I did wrong or where to put the script
1 Like
I wouldn’t recommend doing it this way but since you are an easy fix would be to create a function and run when a player joins.
local function CreateClothing(player)
local Character = player.Character or player.CharacterAdded:Wait()
local Shirt = Character:FindFirstChild("Shirt")
local Pants = Character:FindFirstChild("Pants")
if Shirt then Shirt.ShirtTemplate = "" end
if Pants then Pants.PantsTemplate = "" end
end
local Players = game:GetService("Players")
Players.PlayerAdded:Connect(function(player)
CreateClothing(player)
player.CharacterAdded:Connect(function(char)
CreateClothing(player)
end
end)
What if the player dies? Player.CharacterAdded fires every time a player’s character respawns or spawns in. This includes when the player dies
Also you don’t need a script to auto make clothing. Just do this.
Go to home and press game settings. If u havent published it then do so.
next go to avatar click on it
then scroll down to shirt and pants
then put ur shirt and pants id. That ez
3 Likes
local players = game:GetService("Players")
players.PlayerAdded:Connect(function(player)
player.CharacterAppearanceLoaded:Connect(function(character)
local shirt = character:WaitForChild("Shirt")
local pants = character:WaitForChild("Pants")
local tshirt = character:WaitForChild("ShirtGraphic")
shirt.ShirtTemplate = "" --template here
pants.PantsTemplate = "" --template here
tshirt.Graphic = "" --template here
end)
end)
Local script, place it inside the StarterCharacterScripts or StarterPlayerScripts folder.