I want to give it to the player. But not as soon as they join.
Well, it might be problem with character loading, I have fixed this problem here.
I made 2 scripts, one is local script and second one is script on server side, you donât need both, just select one:
Local character script
local character = game.Players.LocalPlayer.Character
local contentProvider = game:GetService("ContentProvider")
contentProvider:PreloadAsync(character:GetDescendants())
local haveShirt = character:FindFirstChildOfClass("Shirt")
if not haveShirt then
local shirt = Instance.new("Shirt")
shirt.Parent = character
shirt.ShirtTemplate = "http://www.roblox.com/asset/?id=3670737337"
else
character:FindFirstChildOfClass("Shirt").ShirtTemplate = "http://www.roblox.com/asset/?id=3670737337"
end
Server script
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
local haveShirt = character:FindFirstChildOfClass("Shirt")
if not haveShirt then
local shirt = Instance.new("Shirt")
shirt.Parent = character
shirt.ShirtTemplate = "http://www.roblox.com/asset/?id=3670737337"
else
character:FindFirstChildOfClass("Shirt").ShirtTemplate = "http://www.roblox.com/asset/?id=3670737337"
end
end)
end)
If you have any other questions let me know.
Well, the result hasnât changed so far.
The truth is I canât believe you didnât realize it but if you know you would put a shirt in replicated storage with the id then when the playerâs character loads you delete his shirt (ALL PLAYERS HAVE A DEFAULT SHIRT EVEN IF IT ISNâT SEE) you delete it and then clone the replicated storage shirt to the player character