Hey,
So I’m working on a grabbing system which allows players to grab NPCs by the face under a certain health threshold.
Currently I just weld the grab victim to the players hand and set the npcs part networkownership to the player that grabbed them. However it works really strange and keeps bugging out quite often resulting in various bugs such as the NPC taking over the movement control and making it seem like the player is the one being grabbed:
I wish to know if there is any better way to go about a grabbing system like this or if I should stick to welding, and if it is the latter, a potential fix to making the NPC’s seem “Weightless” when you grab them so that the player doesn’t get taken off the ground and carried around by the NPC.
local Grabbed = Instance.new("BoolValue")
Grabbed.Parent = Target.Parent
Grabbed.Name = "Grabbed"
local E
E = Player.Character.Humanoid.Died:Connect(function()
if Grabbed ~= nil then
Grabbed:Destroy()
E:Disconnect()
E = nil
TargetStunned.Value = false
end
end)
Debris:AddItem(Hitbox, 0.001)
local Dome = Target.Parent.Head
Target.PlatformStand = true
local W = Instance.new("Weld")
W.Name = "GrabWeld"
W.Parent = Character
W.Part0 = Dome --The head
W.Part1 = Character["Right Arm"]
W.C0 = CFrame.new(0,0,-1.5)
W.C1 = CFrame.Angles(math.rad(-90),math.rad(180),0)```
Code that is used to "grab" the npc essentially.