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

How do I make a holdable block?

Basically, I made this key that has unions and parts in it and I don't know how to make it so a robloxian can pick it up and hold it in their hand. I tried different ways and the biggest problem I have is the key keeps falling apart into pieces and I tried weld scripts which didnt work out. I don't know what to do. ;o;

2 answers

✓ Accepted answer

Place the item into a tool. It just has to be named "Handle" then the player can hold it. That's the only way I can think of off the top of my head at the moment.

1 comment

0

Also, one weld script you can use is qPerfectionWeld by Qwerty. Just make sure that the script is in the tool and there are no models inside of the tool.

Nevermind, I figured it out after I posted that question but here is the weld script I used which kept the tool and the actual key together.

function weld()
	local parts,last = {}
	local function scan(parent)
		for _,v in pairs(parent:GetChildren()) do
			if (v:IsA("BasePart")) then
				if (last) then
					local w = Instance.new("Weld")
					w.Name = ("%s_Weld"):format(v.Name)
					w.Part0,w.Part1 = last,v
					w.C0 = last.CFrame:inverse()
					w.C1 = v.CFrame:inverse()
					w.Parent = last
				end
				last = v
				table.insert(parts,v)
			end
			scan(v)
		end
	end
	scan(script.Parent)
	for _,v in pairs(parts) do
		v.Anchored = false
	end
end

weld()
script:Remove()

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