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

Welding a part to a player's torso makes the player die on spawn. Any help?

Asked by 9 years ago

******SOLVED!!!

Hi. I've been trying to un-bevel the ROBLOX player (sort of like in the old days, circa 2008). I've got the arms and legs done, but whenever I weld a new part to the torso, the player dies on spawn. Here's my code:

local function trueWeld(a,b)
    local weld = Instance.new("ManualWeld", a)
    weld.Part0 = a
    weld.Part1 = b
    weld.C0 = CFrame.new()
    return weld
end

local function dressCharacter(character)
    character:WaitForChild("Torso").Transparency = 1
    local fakeTorso = game.Workspace.Player:WaitForChild("Torso"):Clone()
    fakeTorso.Parent = character
    trueWeld(character:WaitForChild("Torso"),fakeTorso)

end

game.Players.PlayerAdded:connect(function(player)
    player.CharacterAdded:connect(dressCharacter)
    if player.Character then
        dressCharacter(player.Character)
    end
end)

Anyone knows what I'm doing wrong?

1
What happens if the fakeTorso isn't called Torso? E.g., name it "FakeTorso" in `workspace.Player` BlueTaslem 18071 — 9y
1
I love you BlueTaslem. Thanks for your help over at Reddit! Solved. broetchen 0 — 9y

1 answer

Log in to vote
0
Answered by 9 years ago

In order for it to work, you have to rename the Torso clone. Here is the fix.

local function trueWeld(a,b)
    local weld = Instance.new("ManualWeld", a)
    weld.Part0 = a
    weld.Part1 = b
    weld.C0 = CFrame.new()
    return weld
end

local function dressCharacter(character)
    character:WaitForChild("Torso").Transparency = 1
    local fakeTorso = game.Workspace.Player:WaitForChild("Torso"):Clone()
    faketorso.name = ("FakeTorso")
    fakeTorso.Parent = character
    trueWeld(character:WaitForChild("Torso"),fakeTorso)

end

game.Players.PlayerAdded:connect(function(player)
    player.CharacterAdded:connect(dressCharacter)
    if player.Character then
        dressCharacter(player.Character)
    end
end)

Ad

Answer this question