Trying to make characters massless

im trying to use pcall to check if the function is working but the “success” is giving me "unknown variable. tytyty

script:

		local function removeMass()
			local chars = {
				mychar, -- my character
				otherchar -- another character
			}

			for i, char in pairs(chars) do

				for _, part in char:GetChildren() do
					if part:IsA("BasePart") then
						local success, err = pcall(function()
							if success then
								part.Massless = true
							end
						end)

					end
				end
			end
		end

		removeMass()

image

pcalls
your if statement must be below the pcall
pcalls aren’t really needed here in the first place but heres fixed code

for _, part in char:GetChildren() do
	if part:IsA("BasePart") then
		local success, err = pcall(function()
			part.Massless = true
		end)

		if not success then
			warn(err)
		end
	end
end

ohh thats why. rahh tysm once again bro. ur a lifesaver fr :smiley: