Im trying to make a script where if i press on you, i can take u like ‘hostage’, so i tried welding using motor6d the character i press on, and it doesnt work for some reason, i just cant move at all
code:
if Hitbox.Reference.Value ~= Character then
local TargetChar :Model = Hitbox.Reference.Value
local TargetRootPart :BasePart = TargetChar.HumanoidRootPart
local TargetHuman : Humanoid = TargetChar.Humanoid
if CollectionService:HasTag(TargetChar, "HitBy"..userId) then
return
end
CollectionService:AddTag(TargetChar, "HitBy"..userId)
task.delay(1, function()
CollectionService:RemoveTag(TargetChar, "HitBy"..userId)
end)
CollectionService:AddTag(TargetChar, "WasGrabbed")
for i, v in ipairs(TargetChar:GetChildren()) do
if v:IsA("BasePart") then
v.CanCollide = false
v.Anchored = false
v.Massless = true
end
end
TargetHuman:ChangeState(Enum.HumanoidStateType.Physics)
local motor6d = Instance.new("Motor6D")
motor6d.Part0 = RootPart
motor6d.Part1 = TargetRootPart
motor6d.C0 = CFrame.new(0,0,-2)
motor6d.Parent = TargetRootPart
end
i even set cancollide and anchored and masless correctly and it still doesnt work
The more I think about it, I know the player owns what’s welded to them by default, but since it’s another player with a network owner, I’m gonna assume it has to deal with Ownership. So I could be wrong.
Anyways, like this in Server. And just to be clear player is getting the ownership.
giving a part networkowner basically allow a player to replicate what ever is done to the part to the server . Since character are being moved by the client , the player must have networkownership or the update of the movements will be super low