How to make script only get children that is not named "Rear Live Axle"

Hello Developers,
Is there a way where I can get the script to get only get children that isn’t named “Rear Live Axle”, I have been having trouble with this now.

Help would be appreciated.

Thanks.

UIS.InputEnded:Connect(function(input)
	if input.KeyCode == Enum.KeyCode.LeftShift then
		if UIS:IsKeyDown(Enum.KeyCode.W) then
			connection.Axles["Rear Live Axle"].Cringe.HingeConstraint.MotorMaxAcceleration = config.Acceleration
			connection.Axles["Rear Live Axle"].Cringe2.HingeConstraint.MotorMaxAcceleration = config.Acceleration
			--			Remoteevent:FireServer("normalaccel")
			script.Parent.cargui.boost.Text = "boost = false"
			for i, v in pairs(connection.Axles:GetChildren()) do
				if v.Name == "Rear Live axle" then
					return
				end
			end
			for o, p in pairs(connection.Axles:GetDescendants()) do
				if p:IsA("HingeConstraint") then
					p.MotorMaxAcceleration = 0
				end
			end	
		end
	end
end)
3 Likes

uhhh… you can use the ~= (not equal) symbol?

2 Likes

if v.name == “Rear Live axle”

Maybe you should change axle to Axle?

1 Like

Make sure the if-then statement is checking for the correct name of the object you don’t want to include. You said you want to disinclude “Rear Live Axle”, but you are checking for “Rear Live axle”. Make sure your statement is actually checking for the exact name of the thing you want to stop the script.

1 Like

Maybe you’re checking it wrong? (“Rear Live axle”, not “Rear Live Axle”)
try to check it like this:

for i, v in pairs(connection.Axles:GetChildren()) do
    if string.lower(v.Name) == "rear live axle" then
        return
    end
end