Keeps going to world pos

i want to make it so when dismembered it doesnt go to the world pos it goes to the torso pos

the issue is in this script: ` rightarmsound.Parent = hit
local dismember = game.ReplicatedStorage.Dismemberment.ArmPart:Clone()

				dismember.Parent = hit.Parent
				local offset = Vector3.new(0, 0, 2) -- Modify offset here
				local weld = Instance.new("Weld")
				weld.Name = "Weld"
				weld.Part0 = dismember
				weld.Part1 = hit.Parent.Torso
				weld.Parent = hit.Parent.Torso
				
				weld.Part0.Position = weld.Part0.Position + Vector3.new(1, 0.5, 0) -- issue line
				local clingythingy = game.ReplicatedStorage.HitEffects["Cling thingy"]:Clone()
				clingythingy.Parent = dismember
				debris:AddItem(clingythingy, 0.5)
				rightarmsound:Play()
				hit.CanCollide = true
				if hit.Parent:FindFirstChild("Torso") and hit.Parent.Torso:FindFirstChild("Right Shoulder") then
					hit.Parent.Torso["Right Shoulder"]:Destroy()
				end
				hit.CanCollide = true
				debris:AddItem(rightarmsound, 5)
			else
				hit.Parent:FindFirstChild("Humanoid"):TakeDamage(30)
				if hit.Parent:FindFirstChild("Humanoid").Health <= 0 then
					if Debounce == false then
						Debounce = true
						leaderstats.Kills.Value += 1
						wait(5)
						Debounce = false
					end 
				end
			end
		end`

i have tried cframe wich didnt work and i dont have an example atm cuz i deleted it already
please help me fix it so the i have read some articles about trying it with cframe but it just doesnt work out for me… this line causes the issue: weld.Part0.Position = weld.Part0.Position + Vector3.new(1, 0.5, 0) pls help

4 Likes

weld.Part0 is the cloned dismemberment. You’re basically just moving the dismemberment from it’s initial position.

3 Likes

can you explain? i think i need more info d:

1 Like

In this line, weld.Part0 is declared as the dismemberment.

But later, weld.Part0’s position is it’s OWN position added with the offset. Assuming the dismemberment is not positioned earlier, this is literally why it is offset from the world’s origin.

2 Likes

the thing is that this was already in the code weld.Part0 = dismember weld.Part1 = hit.Parent.Torso weld.Parent = hit.Parent.Torso it welds but i tried to offset it with the vector3 wich doesnt work sadly, i only want the offset to work and then it will be great :smiley: thanks for responding anyway

1 Like

so how would i go ahead and change this?

1 Like

please help me i just cant figure it out D:

1 Like