I'm making an obby game where a part is welded to a player's body. However, I want the part to be above the player, but when the code runs, The part gets put in the player. Why does this happen and how do i fix this? The script is in ServerScriptService. The code is

game.Players.PlayerAdded:Connect(function(plr)
	local part = game.ServerStorage.Part
	plr.CharacterAdded:connect(function(char)
		local clonedPart = part:Clone()
		clonedPart.Parent = char
		local weld = Instance.new("Weld", clonedPart)
		weld.Part0 = char.Torso
		weld.Part1 = weld.Parent
		clonedPart.Anchored = false
		clonedPart.CFrame = char.Torso.CFrame + Vector3.new(0,20,0)
	end)
end)

5 comments

0

The char...Because Character is the player...

0

You need to set C0 and/or C1 to change the offset between the 2 objects. Example is generic teleporting. When you teleport someone, you set their Torso's CFrame. Does that make only their Torso move? Naw, it makes the whole welded body move together as a unit.

0

The parent argument to Instance.new is deprecated, assign the parent in another line

0

Incapaz ur not helping this guy. You're not even answering the question he askeddd

0

Try character.Head at line 07