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

I dont know what cframe value i should edit to make the tool face correctly?

May seem dumb, but I needed a script to weld together a bunch of unions in a tool, a friend recommended

function Weld(x,y)
	local W = Instance.new("Weld")
	W.Part0 = x
	W.Part1 = y
	local CJ = CFrame.new(x.Position)
	local C0 = x.CFrame:inverse()*CJ
	local C1 = y.CFrame:inverse()*CJ
	W.C0 = C0
	W.C1 = C1
	W.Parent = x
end

function Get(A)
	if A.className == "UnionOperation" then
		Weld(script.Parent.Handle, A)
		A.Anchored = false
	else
		local C = A:GetChildren()
		for i=1, #C do
		Get(C[i])
		end
	end
end

function Finale()
	Get(script.Parent)
end

script.Parent.Equipped:connect(Finale)
script.Parent.Unequipped:connect(Finale)
Finale()

But when I test, it welds everything together perfectly, It is angled the wrong way,

local C0 = x.CFrame:inverse()*CJ
local C1 = y.CFrame:inverse()*CJ

I tried editting that to get it to angle correctly, it angles straight up, but if the y axis went to the front by 90 degrees, it would be fine

3 comments

1

The tool itself is angled the wrong way? Or the parts are in the correct position and rotated wrong? Sorry for the confusion

0

you need to rotate part x

0

So Every single part is angled the wrong way, It is all angled straight up, parallel to the player body, I want it to be straight, parallel with the arm

1 answer

Do find a cframe location of something all u do is run the game, then move ur roblox Character to the deriction you want the cframe to be then while the game is runnning goto workspace select the model with ur name then goto the Head Part and under which is the property u'll see a section called location and that will be the loaction

1 comment

0

hope it works

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