Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Welding won't work?

Asked by
Spoookd 32
8 years ago

I am trying to Weld a part to a player when they join the game, but the part just sits on the baseplate.

local function weldBetween(a, b)
    print(a, b)
    local weld = Instance.new("Weld", a)
    weld.Part0 = a
    weld.Part1 = b
    weld.C0 = a.CFrame:inverse() * b.CFrame

 a.LocalTransparencyModifier = 0

    return weld
end

game.Players.PlayerAdded:connect(function(plr)
    plr.CharacterAdded:connect(function(chr)
    chr:WaitForChild( "Torso" )
        local part = Instance.new("Part", game.Workspace)
        part.Name = "Welded Part"
        part.Size = Vector3.new(2,2,2)
    part.CFrame = chr.Torso.CFrame -- Position it somewhere, or else it will spawn at 0,0,0 and weld to player from that distance

        local weld = weldBetween(part, chr.Torso)
    end)
end)

0
Is the part anchored? tkddude2 75 — 8y
0
If the part was anchored, the player wouldn't be able to move, so no. TheDeadlyPanther 2460 — 8y

Answer this question