im trying to make a gui button that equips a shirt on the player that presses it
serverscript:
local click = script.Parent
local ID = script.Parent.ID.Value
click.MouseButton1Click:Connect(function(player)
if player.Character:FindFirstChild("Shirt") ~= nil then
player.Character.Shirt.ShirtTemplate = ID
else
local Shirt = Instance.new("Shirt",player.Character)
Shirt.ShirtTemplate = ID
end
end)
error:
Attempted to index nil with ‘character’