I need help with my rotation

Hello, i have been working for the past 45 minutes on why is this happening and i cant find why.

What i have :
image
What i want :

Script :

Can anyone help me to get the exact position?

My script sucks, but try testing it out:

		local radio = workspace.Part:clone() -- replace workpace.Part with your radio variable
		radio.Name = "Radio"
		local parent = script.Parent -- the player model

		-- Weld to UpperTorso
		local weld = Instance.new("Weld", radio)
		weld.Part0 = parent.UpperTorso
		weld.Part1 = radio
		weld.C0 = CFrame.new(0, 0, 0.85)
		weld.C1 = CFrame.fromEulerAnglesXYZ(0, math.pi, math.pi * 1 / 4)
		radio.Parent = parent

Once you do some minor edits, it should work fine.
Make sure to keep me updated!

Where do i put this script? inside the tool or where?

preferably inside the script you displayed. make sure to edit the variables

Its not working i cant find how

Show me your current script, please

Like the entire script???

Just show me the part where you placed my code in

Well then send the your whole script and ill make the edits

handle = nil

function onUnequipped()
if script.Parent.Parent == workspace or script.Parent.Parent.className ~= “Backpack” then
return
end

local char = script.Parent.Parent.Parent.Character
if char ~= nil then
	local torso = char:findFirstChild("UpperTorso")
	local tool = char:findFirstChild(script.Parent.Name)
	
	if torso ~= nil and tool == nil then
		local model = Instance.new("Model")
		model.Name = script.Parent.Name
		model.Parent = char

		handle = script.Parent.Handle:clone()
		handle.CanCollide = false
		handle.Name = script.Parent.Name
		handle.Parent = model

		local weld = Instance.new("Weld")
		weld.Name = "BackWeld"
		weld.Part0 = torso
		weld.Part1 = handle
		weld.C0 = CFrame.new(0,0,0.6)
	
		--weld.C0 = weld.C0 * CFrame.Angles(27.85, 60.84, 5.89)
		weld.C0 = weld.C0 * CFrame.Angles(-66, -66, 66)
		weld.Parent = handle
	end
end

end

script.Parent.Unequipped:connect(onUnequipped)

function onEquipped()
if handle ~= nil then
handle.Parent:remove()
end
end

script.Parent.Equipped:connect(onEquipped)

I dont know why some part of the script are in a box so here a screen

I made some minor edits, Try this, and tell me if it doesnt work!

local handle = nil

function onEquipped()
	if script.Parent.Parent == workspace or script.Parent.Parent.ClassName ~= "Backpack" then
		return
	end

	local char = script.Parent.Parent.Parent.Character
	if char ~= nil then
		local torso = char:findFirstChild("UpperTorso")
		local tool = char:findFirstChild(script.Parent.Name)

		if torso ~= nil and tool == nil then
			local distanceFromBack = 0.85
			local model = Instance.new("Model")
			model.Name = script.Parent.Name
			model.Parent = char
			
			handle = script.Parent.Handle:clone()
			handle.CanCollide = false
			handle.Name = script.Parent.Parent.Name
	
			local weld = Instance.new("Weld", handle)
			weld.Part0 = torso
			weld.Part1 = handle
			weld.C0 = CFrame.new(0, 0, distanceFromBack)
			weld.C1 = CFrame.fromEulerAnglesXYZ(0, math.pi, math.pi * 1 / 4)
			weld.Name = "BackWeld"
			
			handle.Parent = model
			
		end
	end
end
function onUnequipped()
	if handle ~= nil then
		handle.Parent:remove()
	end
end

script.Parent.Unequipped:connect(onUnequipped)
script.Parent.Equipped:connect(onEquipped)
1 Like

Nvm i fixed it
image

but now its like this

press f9 instead and show me that log, i need to see a few more things

I kinda fixed it but its still not in the correct position
image

is it too far from the back? :thinking:

No here what i want

keep editing this variable until you get right positioning

But my problem isnt the distance from back

image

edit that part with:

weld.C1 = CFrame.fromEulerAnglesXYZ(0, 8, math.pi * 1 / 4)
1 Like