-
If I press G, a player will weld to me, and if I press G again they’ll unweld.
-
Once unwelded, player will teleport back to an old position.
-
Nothing
If G was pressed and player is not welded
local Players = game:GetService("Players")
local character = player.Character
local partA = target.HumanoidRootPart
partA.Name = "PlayerHumanoid"
local partB = character.Torso
partA.Position = Vector3.new(0, 10, 0)
partB.Position = Vector3.new(0, 10, 3)
partA.Parent = character
local weld = Instance.new("Weld")
weld.Name = "Weld1"
weld.Parent = character.Torso
weld.Part0 = partA
weld.Part1 = partB
weld.C1 = CFrame.new(2, 0, -2)
target.Humanoid.PlatformStand = true
target.Humanoid.HumanoidRootPart.CanCollide = false
target.Torso.CanCollide = false
If player was welded and G was pressed
elseif gactivated == true then
gactivated = false
target.gValue.Value = false
local Players = game:GetService("Players")
local character = player.Character or player.CharacterAdded:wait()
character.PlayerHumanoid.Parent = target
target.PlayerHumanoid.Name = "HumanoidRootPart"
target.HumanoidRootPart.CanCollide = true
target.Humanoid.PlatformStand = false
target.Torso.Anchored = false
target.Torso.CanCollide = true
robloxapp-20220310-1934574.wmv (1.6 MB)