Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

breakjoints not working?

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

✓ Accepted answer

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

This discussion is preserved as it was. New answers, comments, and votes are closed.