Hey, so I’m trying to script it so the script looks for a shirt on the player and if the character doesn’t have a shirt, it makes the id = 0 for the shirt from the viewmodel. Yet, for some reason, it doesn’t work when it doesn’t find the shirt. It works when it finds a shirt though. I’d really appreciate the help!
Code:
local foundShirt = Character:FindFirstChild(“Shirt”)
if not foundShirt then
viewModel.LeftArm.Shirt = 0
viewModel.RightArm.Shirt = 0
else if foundShirt then
viewModel.RightArm.Shirt.Texture = Character.Shirt.ShirtTemplate
viewModel.LeftArm.Shirt.Texture = Character.Shirt.ShirtTemplate
end
end
-- ServerScript
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
local humanoid = character:WaitForChild("Humanoid") --load pause
print(character)
end)
end)
--ClientScript
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid") --load pause
print(character)
I only put a very small portion of the script (where the error comes from). I actually asked AI and it actually helped see what I did wrong, but I appreciate the help