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

Why is my custom tool glitched when I equip it?

So, I made my own custom shop GUI and I put a tool into the ReplicatedStorage and I bought it. But, when I equip it my character does flips and rotates. All I did for this item is make one of the 2 parts say "Handle" , I didn't script the tool yet. Is that what I am missing... Please Help Me. Thank you

4 answers

If your tool is anchored it will do that. You can either:

  1. Go to the properties of the tool and uncheck anchored or
  2. When scripting add this line:
game.ReplicatedStorage.Tool.Anchored = false

2 comments

0

ok I did that know it works but, only the handle shows...

0

Use welds

ok I did that know it works but, only the handle shows...

Weld the sword together

I don't really want to explain, but if you need an explanation here's a link to the wiki. If you have any particular questions ask me.

-- Regular script inside tool
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()
I did not personally make this script. I'm unsure who made this script.

And as others suggested, unanchor the tool.

Good Luck!

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