Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Part cloning not next to the player it clones in the player instead?

function ActivateGrimore(Player)
	warn("Server Side Activated")
	local Char = Player.Character
	local Hurmp = Char.HumanoidRootPart
	
	local newgm = script.Open:Clone()
	newgm.Parent = Char
	newgm.CFrame = Hurmp.CFrame * CFrame.new(0,0,2)
	
	wait(.1)
	
	local NewWeld = Instance.new("Weld")
	NewWeld.Parent = Hurmp
	NewWeld.Part0 = Hurmp
	NewWeld.Part1 = newgm
	
end

So instead of it going infront of the player it just stays in the middle does is this caused by the weld?

1 answer

✓ Accepted answer

Yes it is caused by the weld. Here you would want to set the C0 (or C1) property of the weld for an offset.

ex. NewWeld.C0 = CFrame.new(0, 0, -2)

this would make the part be 2 studs in front of your humanoidrootpart (if the humanoidrootpart is the weld's Part0)

2 comments

0

Hey quick question how can i change the rotation for the cloned part cause when i use newgm.orientation it does not work?

0

Multiply the CFrame by CFrame.Angles(), for example: NewWeld.C0 = CFrame.new(0, 0, -2) * CFrame.Angles(math.rad(90), 0, 0)

This discussion is preserved as it was. New answers, comments, and votes are closed.