I have a gun. I'm currently just trying to get the character to hold it when ti is equipped. Here is the script I have:
script.RemoteEvent.OnServerEvent:connect(function(plr)
local handle = script.Parent.Handle
print("Equipped")
local rarm = script.Parent.Parent["Right Arm"]
local weld = Instance.new("Weld")
weld.Part0 = rarm
weld.C0 = rarm.CFrame:inverse()
weld.Part1 = handle
weld.C1 = handle.CFrame:inverse()
local modelparts = script.Parent.Handle:GetChildren()
for i, v in pairs(modelparts) do
if v.ClassName == "Tool" then
local gunweld = Instance.new("Weld")
weld.Part0 = handle
weld.C0 = handle.CFrame:inverse()
weld.Part1 = v
weld.C1 = v.CFrame:inverse()
print("welded something")
end
end
end)
The handle is welded just fine. It's currently visible, so I can see the small part in my hand. But the rest of the gun just falls through the floor and doesn't even go remotely near the handle.
