Hello! I made script which giving decal on torso when you gonna click brick, but it's not working any ideas what's wrong?
This is this script
local brick = script.Parent
local decal = brick:findFirstChild("Decal")
script.Parent.ClickDetector.MouseClick:connect(function(player)
local humanoid = player.Parent:findFirstChild("Humanoid")
local torso = player.Parent:findFirstChild("Torso")
if torso ~= nil and humanoid ~= nil then
local shirt = player.Parent:findFirstChild("Shirt Graphic")
if shirt ~= nil then
shirt.Graphic = decal.Texture
else
local altshirt = torso:findFirstChild("roblox")
if altshirt ~= nil then
altshirt.Texture = decal.Texture
else
print("Torso found. Shirt not found. Assumed to be a robot.")
end
end
else
print("Not a valid person! T-Shirt cannot be changed!")
end
end)

1 comment
Works, thank you