Different cframe depending on on the parent instance

How would I have a different cframe depending on which folder the instance is in?
image_2022-02-08_194818
image
Like if it’s in secondary, the cframe would be 45 degrees but if its in primary it would be 90

What’s the parent folder for all of that four folders? You should always include that in your picture.

Basically, just use :GetDescendants() on the parent folder of all of that four folders and check the parent folder of the instances. then set the cframe accordingly.

image

What I’m basically trying to do is have a different position and rotation for each category of weapons and how im trying to do it is like If the primary folder has a child that matches the tool name it would weld in that way and i dunno how else to do it

Couldn’t you do it as I told you to?

for _, instance in pairs(Weapons:GetDescendants()) do
   if instance:IsA("Tool") then
      if instance.Parent.Name == "PRIMARY" then
         --rotate
      else if instance.Parent.Name == "SECONDARY" then
         --rotate somewhere else
      end
   end
end

It doesnt seem to work I think Its w something i wrote down incorrectly, you want me to send the most the script?

alr sure lets go man lets do this

1 Like

Alright so I ended up using attributes instead of getting descendants and everything else and it works!
image
still thanks for the help and for putting up with me lmao