Player1 should be allowed to move around, and when they move Player2 should be attached to them. There seems to be no attachment at all atm
local function InputBegan(input, GPE)
if GPE then return end
if input.KeyCode == Enum.KeyCode.E then
-- Create weld
local Weld = Instance.new('Weld')
Weld.Parent = workspace['Player1']
Weld.Part0 = workspace['Player2'].HumanoidRootPart
Weld.Part1 = workspace['Player1'].HumanoidRootPart
-- Make carried character unanchored
for _, v in pairs(workspace['Player2']:GetDescendants()) do
if v:IsA('Part') or v:IsA('UnionOperation') or v:IsA('MeshPart') then
v.Anchored = false
end
end
end
end
game:GetService('UserInputService').InputBegan:Connect(InputBegan)
Yup, try shifting the players in the function. And about the freezing. Try to set the player to a state, like Sitting = true or maybe PlatformStanding = true
This may not help at the moment, but I read in another post that you could attach parts to you if the parts were massless. Try to loop through the other character’s body to make their parts massless.
Another thing you could do is disable all of the motor6D joints. I don’t particularly know if that will work, but it will stop someone from moving.
I use this and works fine… just adapt it for ur needs
EDIT: I made a mistake… welp Im not testing it, but yeah xD I guess I fixed it :v
local ps = game:GetService("PhysicsService")
ps:CreateCollisionGroup("colG")
ps:CollisionGroupSetCollidable("colG","colG",false)
local function weldPlayers(holder, bag)
local holderPlayer = holder.Character.Head
local bagPlayer = bag.Character.PrimaryPart
bag.Character.Humanoid.PlatformStand = true
local weld = Instance.new("Weld")
weld.Name = "bagWeld"
weld.Part0 = bagPlayer
weld.Part1 = holderPlayer
weld.C1 = CFrame.new(0, 3, 0) -- Change it to offset the bag player :v
weld.Parent = bagPlayer
-- Cancel Collisions
for _,v in pairs(bag.Character:GetChildren()) do
if v:IsA("BasePart") then
ps:SetPartCollisionGroup(v,"colG")
v.Massless=true -- Make the bad massless
end
end
for _,v in pairs(holder.Character:GetChildren()) do
if v:IsA("BasePart") then
ps:SetPartCollisionGroup(v,"colG")
end
end
end
weldPlayers("holder player", "bag player") -- Add ur players as u wish
Iterate in both player’s Childrens, find the “Weld” and Destroy()
Set the Character.Humanoid.Platform = false
and Iterate until find their BasePart and set Massless = false, and CollisionGroupId = 0
You have to do this for both players, except the Massless
local function unWeldPlayers(plr)
plr.Character.Humanoid.PlatformStand = false
local weld2Del = plr.Character.PrimaryPart:FindFirstChild("bagWeld")
weld2Del:Destroy()
for _, v in pairs(plr.Character:GetChildren()) do
if v:IsA("BasePart") then
v.CollisionGroupId = 0
v.Massless = false
end
end
end
unWeldPlayers("desired player")
Yup.
This line v.CollisionGroupId = 0
is setting ur player’s CollisionGroup to the Default CollisionGroup. If u are using custom Groups, you need to change the id number to the one that u are using to manage ur CollisionGroups in ur game
Actually, notice that in the start of the script, we’re creating a collision group to handle both players to not collide, if you are already using custom groups just change those lines to whatever u need in ur game :3