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

Changing the orientation of a Torch welded to a player's LeftHand?

this is the script used, it welds the torch to the left hand when you walk over the torch

script.Parent.Touched:Connect(function(hit)
	local humanoid = hit.Parent:FindFirstChild("Humanoid")
	if humanoid then
		local hand = hit.Parent.LeftHand
		script.Parent.CFrame = hand.CFrame
		local weld = Instance.new("Weld")
		weld.Part0 = hand
		weld.C0 = hand.CFrame:Inverse()
		weld.Part1 = script.Parent
		weld.C1 = script.Parent.CFrame:Inverse()
		weld.Parent = script.Parent
		script.Parent.anchored = false
	end
end)

--full credit to PeasFactory on yt, welding is totally new to me as of now

this script welds totally fine, but the fire end of the torch is being jammed directly inside of the players arm. is there a way to edit the orientation of it? pardon my lack of actual scripting terms/original script, i still suck :)

1 answer

I found a solution! since the script sets the CFrame to the hand's, i just added a new block to the torch model and put the script there. that way, i just turned that new block until it looked nice :) sorry if this answer is kinda vague for anyone else having this exact specific problem but, ya know, script noob here

1 comment

1

Mark this as your solution or just delete the question

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