My script doesnt seem to work, and im 99.9% positive its something on my end im doing wrong. heres the script working, anyone help with adding it so when a character loads to, they get it?
local shirtId = script.Parent.Parent.Coathanger.Shirt.ShirtTemplate
local cPart = script.Parent
-- Functions --
local function playSoundLocal(sId,sParent)
local sound = Instance.new("Sound",sParent)
sound.SoundId = "http://www.roblox.com/asset/?id="..sId
sound:Play()
sound:Destroy()
end
game.Players.PlayerAdded:connect(function(player)
repeat wait() until player.Character
if player.leaderstats.Money12.Value>= 1 then
print(player.Name.." clicked on Uniform Giver")
local foundShirt = player.Character:FindFirstChild("Shirt") -- Tries to find Shirt
if not foundShirt then -- if there is no shirt
print("No shirt found, creating for "..player.Name)
local newShirt = Instance.new("Shirt",player.Character)
newShirt.Name = "Shirt"
else if foundShirt then -- if there is a shirt
print("Shirt found, reconstructing for "..player.Name)
player.Character.Shirt:remove()
local newShirt = Instance.new("Shirt",player.Character)
newShirt.Name = "Shirt"
player.Character.Shirt.ShirtTemplate = shirtId
end
end
end
end)

2 comments
Any errors in the output?
No. It just doesn't happen.