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

My script breaks after a certain period of time. What do?

Asked by 9 years ago

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?

0
No need for the conditional on line 21, as the 'CharacterAdded' event ensures the character has been loaded and exists. DigitalVeer 1473 — 9y
0
So I remove that line and it'll be OK? broetchen 0 — 9y
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) BlueTaslem 18071 — 9y

Answer this question