Hello, so i’m trying to make a Try Clothing gui, and I was testing everything with printing. But I keep on getting an error while checking if the Shirt is part of the character. This is a local script in the billboard gui.
--//Services
ReplicatedStorage = game:GetService("ReplicatedStorage")
--//Variables
local buyPantsButton = script.Parent.BuyPantsButton
local buyShirtButton = script.Parent.BuyShirtButton
local player = game:GetService("Players").LocalPlayer
local character = player.Character or player.ChildAdded:Wait()
--//Script
--//Checking for pants and Shirt
if not script.Parent.Adornee.Pants then
script.Parent.BuyPantsButton.Visible = false
elseif not script.Parent.Adornee.Shirt then
script.Parent.BuyShirtButton.Visible = false
end
buyShirtButton.MouseButton1Click:Connect(function()
local shirt = character.Shirt
if shirt then
print("shirt")
else warn("no shirt")
end
end)
When I run this script I immediately get this error in my output without the script even checking the else
.