detector.Touched:Connect(function(part)
if part.Name == "Fabric" and part:HasTag("Unprocessed") then
part:RemoveTag("Unprocessed")
Activated()
local rng = math.random(1, 2)
print("RNG")
if rng == 1 then
local shirt: Model = game.ServerStorage.Shirt:Clone()
for _, v in shirt:GetChildren() do
v.Color = part.Color
end
shirt.PrimaryPart.CFrame = CFrame.new(part.Position, part.Orientation)
part:Destroy()
shirt.Parent = workspace
else
local pants: Model = game.ServerStorage.Pants:Clone()
for _, v in pants:GetChildren() do
v.Color = part.Color
end
if pants.PrimaryPart == nil then
print("No primary part")
end
pants.PrimaryPart.CFrame = CFrame.new(part.Position, part.Orientation)
part:Destroy()
pants.Parent = workspace
end
else
print("Not Fabric")
end
end)
This script basically gets a part that touches something, then turns it into either a shirt or pants. However, the shirts spawn fine and replicate position and orentation of the part, but the pants spawn in but don’t copy the position or orentiation (they just spawn in their og position from serverstorage)
The pants are still not working. It’s werid because the shirts work and they are the exact same script. The pants have a primary part, and the model is structured exactly like the shirt.