script.Parent.Triggered:Connect(function()
local MFold = game.Workspace.ModelFolder
if humanoid then
for _, getSonin pairs(MFold:GetChildren()) do
if head:IsA("Model") and getSon:FindFirstChild("Head") then
local changePos = MFold.getSon.Head.Position
when Trigger the part should move to the child model, regardless of name, if the model is looking for a child named Head
but for some reason mine doesn’t work, anyone know?
This could be many different things because you’ve only posted a tiny fraction of your code which includes variables whose declarations are never shown
You should try putting print statements between lines to at least narrow down where the problem lies and then let us know what the output says because right now there’s not many clues for us
In that for loop, you are doing :FindFirstChild('Head') but in the changepos line, you are doing local changePos = MFold.head.Head.Position. Why is it that the children you are stating have different names? Change that accordingly
oh yes, I’m sorry for the confusion, forget the bos var I have changed it to Char, because here I want to get Head in the model, without knowing the name of the model. @MysteryX2076@Physicism@killermurderator