Hello, I have a script where it is supposed to “equip” a custom tool through this function:
local serverStorage = game:GetService("ServerStorage")
local actions = {}
function actions.EquipItem(player, itemName)
local char = player.Character
if serverStorage.Items[itemName] and player.Inventory.Items[itemName] then
if char:FindFirstChild("Item") then
char:FindFirstChild("Item"):Destroy()
end
local itemClone = serverStorage.Items[itemName]:Clone()
itemClone.Name = "Item"
itemClone.Parent = char
itemClone:SetPrimaryPartCFrame(char.RightHand.CFrame)
local weld = Instance.new("WeldConstraint", itemClone.Handle)
weld.Part0 = itemClone.Handle
weld.Part1 = char.RightHand
end
end
return actions
It’s using welds to weld a handle onto the characters right hand, and then I weld the other parts of the tool to the handle. For some models it works perfectly, but others it doesn’t work. For the ones that don’t work it shows the Item model and handle, but it appears as if the other parts have been deleted or parented elsewhere?
Here are the models I’m trying, the paper doesn’t work and the pillow does.
Do you have any ideas on what is going wrong? I can give more information if need. Thanks in advance!