A part cloned from a server script does not get position from humanoidrootpart

I’m doing a kind of transformation from a server script but when I clone a part and give it its position, the object remains where it was.
image
my code here:

scp323orbe:Clone().Parent = workspace

	if humanoid.Health > 0 then
		local orbetransform = workspace:WaitForChild("scp323efectos")
--this is where it doesn't work
		orbetransform.CFrame = CFrame.new(humanoidrootpart.Position)
1 Like

Is this the entire code? Because you are missing variables.

E.g.

local humanoidrootpart = Player.Character.HumanoidRootPart

I have the complete code but it is long, I only put that part of the script because that is where it does not work, I don’t get an error or anything but it just doesn’t work

1 Like

ah alright. Maybe try it with Position instead of CFrame

Try:
orbetransform.CFrame = orbetransform.CFrame = CFrame.new(humanoidrootpart.Position)

I think that I already tried with all the variables that there are

Any errors on the Output at all?

I do not get any error, the cantouch, cancollide, lock, and massless are disabled, I also tried with some and nope

Why is there 2 equal signs in the thing

a = a = 5? I didnt know that works

My only guess is that “scp323efectos” doesn’t actually exist and “WaitForChild” is running indefinitely. Make sure the part is actually named “scp323efectos” since nothing is actually wrong with the code.

If it happens to be a “Model” instance then consider using “MoveTo()” instead.

Edit: Another thing you can do is use a variable to clone your part, and use the variable as the object data to move the part.

local part = scp323orbe:Clone()
part.Parent = workspace

if humanoid.Health > 0 then
    part.CFrame = CFrame.new(humanoidrootpart.Position)
end