Hi. I've scripted an unbevel character script with help of many Redditors, but after a certain ammount of player join (I think that's the problem) the script just breaks. Any solutions?

--LEFT ARM--

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("Left Arm").Transparency = 1
    local fakeLeftArm = game.Workspace.Player:WaitForChild("lArm"):Clone()
    fakeLeftArm.Parent = character
    trueWeld(character:WaitForChild("Left Arm"),fakeLeftArm)
		character:WaitForChild("lArm").CanCollide = false
end

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

--//LEFT ARM\\--

That's part of my script. It's basically that, copypasted for every part of the player model. Any clue?

3 comments

0

No need for the conditional on line 21, as the 'CharacterAdded' event ensures the character has been loaded and exists.

0

So I remove that line and it'll be OK?

0

DigitalVeer: If the character already happened to exist before the :connect, it wouldn't happen. That probably shouldn't happen, but you never know --it makes this more general (e.g., you can use it not just on newly joining players)