I am trying to create a larger hitbox of the tool upon pressing the key E. I've tried changing the current hitbox of the tool in the script and I tried replacing the hitbox of the Tool with a hitbox that is bigger but both seem to cause the hitbox to fall off and go through the map.
the current part of the script I have now is:
game:GetService('UserInputService').InputBegan:Connect(function(input, process)
if input.UserInputType == Enum.UserInputType.Keyboard and not process then
if input.KeyCode == Enum.KeyCode.E and Player and character and Tool.Handle.Value.Value == 1 then
Tool.Handle.Value.Value = 2
game.Debris:AddItem(Tool.Hitbox,0.1)
local chkhitbox = game.ReplicatedStorage.ChakraHitbox:Clone()
chkhitbox.CFrame = Tool.Handle.CFrame
chkhitbox.Parent = Tool
chkhitbox.Name = "Hitbox"
the weld script is
local RbxUtility = LoadLibrary("RbxUtility")
local Create = RbxUtility.Create
local Tool = script.Parent
local Handle = Tool:WaitForChild("Handle")
local function Weld(X, Y)
local CJ = CFrame.nelw(X.Position)
local C0 = X.CFrame:inverse()*CJ
local C1 = Y.CFrame:inverse()*CJ
local W = Create("Weld"){
Name = "Weld",
Parent = X,
Part0 = X,
Part1 = Y,
C0 = C0,
C1 = C1
}
end
local function WeldObjects(parent)
for i, obj in pairs(parent:GetChildren()) do
if obj:IsA("Part") or obj:IsA("UnionOperation") then
Weld(Handle, obj)
obj.Anchored = false
-- print("[Weld] Objects have been welded!")
end
end
end
Tool.Equipped:connect(function()
WeldObjects(Tool)
end)
Tool.Unequipped:connect(function()
WeldObjects(Tool)
end)`

7 comments
This is only part of the script I have for the tool... the rest of the script works... just not the changing hitbox part.
Have you tried making it into a function when changing the size and anchoring it while redoing the weld?
Please stop making your question titles all caps.
@M39a9am3R NO.
@seith14 not exactly sure what you mean... i tried welding the parts back together during the e function but it didn’t work for some reason although i can try again if that’s what you mean
Alright... I can start adding notes to your questions until you stop putting your titles in all caps.
@M39a9am3R why does it matter in the first place though? Seems like you’re just being petty for no reason