I'm trying to make a brick, and when you touch the brick it removes your shirt and pants(if your wearing them). and removes your t-shirt. then it clones its shirt and pants inside the model into the player. But I keep getting an error saying: 17:16:18.904 - The Parent property of Shirt is locked, current parent: NULL, new parent Player
Script:
local cln = script.Parent.Pants:clone()
function onTouched(hit)
local h = hit.Parent:findFirstChild("Humanoid")
if h~=nil then
local s = hit.Parent:findFirstChild("Pants")
if s ~= nil then
s:Destroy()
cln.Parent = h.Parent
elseif s == nil then
cln.Parent = h.Parent
end
end
end
script.Parent.Touched:connect(onTouched)
Same with the shirt script:
local cln = script.Parent.Shirt:clone()
function onTouched(hit)
local h = hit.Parent:findFirstChild("Humanoid")
if h~=nil then
local s = hit.Parent:findFirstChild("Shirt")
if s ~= nil then
s:Destroy()
cln.Parent = h.Parent
elseif s == nil then
cln.Parent = h.Parent
end
local t = h:findFirstChild("roblox")
if t ~= nil then
t:Destroy()
elseif t == nil then
print("no tshirt")
end
end
end
script.Parent.Touched:connect(onTouched)

1 comment
wait it didnt work.