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

breakjoints not working?

Asked by 8 years ago

ok so i am just reseting every player in the game i have referenced the wiki and past questions but it still doesnt work and my game still crashes to go with it any help?

here is my code

function eF()
    wait(5)

    for j, k in pairs(game.Players:GetPlayers()) do
        local c = game.Workspace:FindFirstChild(k.Name)

        if c then
            print (c)
            c:BreakJoints()
        end
    end

    survivorList = {}
    infectedList = {}
    iR = false
    infected = nil

    wait(1)

    serverCheck()
end

1 answer

Log in to vote
1
Answered by
Wutras 294 Moderation Voter
8 years ago

The :BreakJoints() function can ONLY be used on Parts or UnionOperations; Objects with Welds. Thus I'd propose you to break the joints of a part of the player that is needed for surviving.

function eF()
    wait(5)

    for j, k in pairs(game.Players:GetPlayers()) do
        local c = k.Character -- The Character is a variable of the Player which is related to the player's character.
        if c then
                print (c)
                c.Torso:BreakJoints() -- The Torso is needed for surviving and a Part with Welds.
        end
    end

    survivorList = {}
    infectedList = {}
    iR = false
    infected = nil

    wait(1)

    serverCheck()
end

Ad

Answer this question